Well, at least a riddle for me. Consider the following:
import time import signal def catcher(signum, _): print "beat!" signal.signal(signal.SIGALRM, catcher) signal.setitimer(signal.ITIMER_REAL, 2, 2) while True: time.sleep(5)
It works as expected, that is, it delivers a "bit!". message every 2 seconds. Then the conclusion is not made:
import time import signal def catcher(signum, _): print "beat!" signal.signal(signal.SIGVTALRM, catcher) signal.setitimer(signal.ITIMER_VIRTUAL, 2, 2) while True: time.sleep(5)
Where is the problem?
python signals timer
jldupont Feb 18 '10 at 20:43 2010-02-18 20:43
source share