[PERL] Timer
CS/Shell/Perl/Python 2010. 8. 16. 12:44#!/usr/bin/perl use Time::HiRes qw(ITIMER_REAL setitimer); $SIG{ALRM} = sub { print "Alarm\n"; }; setitimer(ITIMER_REAL, 0.1, 5); while (1) { sleep ; print "Main Loop\n"; }
[PERL] TimerCS/Shell/Perl/Python 2010. 8. 16. 12:44#!/usr/bin/perl use Time::HiRes qw(ITIMER_REAL setitimer); $SIG{ALRM} = sub { print "Alarm\n"; }; setitimer(ITIMER_REAL, 0.1, 5); while (1) { sleep ; print "Main Loop\n"; } |