fork download
  1. from time import sleep
  2. from threading import Timer
  3.  
  4. def setTimeout(f,t):
  5. Timer(t,f).start()
  6. def test_function():
  7. print 'test'
  8.  
  9. setTimeout(test_function,2.5)
  10. for i in range(5):
  11. print i
  12. sleep(1)
Success #stdin #stdout 0.02s 16320KB
stdin
Standard input is empty
stdout
0
1
2
test
3
4