Created
May 15, 2012 17:01
-
-
Save mshock/2703298 to your computer and use it in GitHub Desktop.
alarm scheduling framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
$SIG{ALRM} = \&ten_min_task; | |
alarm (600); | |
while (1) { | |
# run in between task here | |
#sleep 1; print "foo\n"; | |
} | |
# asynchronous interrupt task | |
sub ten_min_task { | |
alarm 600; | |
# run this code every 10 minutes | |
#print "bar\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment