You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
507 B

3 years ago
  1. """
  2. Python file for Processor test suite
  3. Infinite loop which purposefully ignores
  4. Keyboard Interrupts in order to continue
  5. executing. The only way to kill it is via
  6. SIGTERM family signals.
  7. """
  8. import time
  9. import sys
  10. if sys.platform.startswith('win'):
  11. import ctypes
  12. kernel32 = ctypes.WinDLL('kernel32')
  13. kernel32.SetConsoleCtrlHandler(None, 0)
  14. while True:
  15. try:
  16. print(time.time())
  17. time.sleep(0.1)
  18. except KeyboardInterrupt:
  19. # Ignored!
  20. print("INTERRUPT")