Posted By

jarnaldich on 06/01/12


python timer Threading

Versions (?)

Python Time Bomb

 / Published in: Python

Making a python process exit with error code 1 after 30 seconds. Exit is unclean (no garbage is collected, no flushed buffers, etc...).

  1. from threading import Timer
  2. Timer(30, lambda : os._exit(1)).start()

Report this snippet  

You need to login to post a comment.