4

The following code works in Unix, but i would like to transfer it to a Windows OS. The problem is that in Windows signal.SIGALRM and signal.setitimer don't work. I would really appriciate if someone could help me.

def handler(signum, frame):
   counter += 1
   print(counter)


signal.signal(signal.SIGALRM, handler)
signal.setitimer(signal.ITIMER_REAL, UPDATE_INTERVAL, UPDATE_INTERVAL)


for i in xrange(10):
    # Wait for signal to be received
    signal.pause()

# Print the stop time, in case you wanted to know.
_initTime()
print "Stop:", _now()

signal.setitimer(signal.ITIMER_REAL, 0)
Unai Vivi
  • 3,073
  • 3
  • 30
  • 46
EmbedEngineer
  • 93
  • 2
  • 7
  • 1
    see this similar [question](http://stackoverflow.com/questions/8420422/python-windows-equivalent-of-sigalrm) and answer – Dave Aug 13 '14 at 18:24
  • 1
    Does this answer your question? [python: windows equivalent of SIGALRM](https://stackoverflow.com/questions/8420422/python-windows-equivalent-of-sigalrm) – Bill Huang Oct 25 '21 at 09:39

0 Answers0