Logo

Programming-Idioms

History of Idiom 185 > diff from v9 to v10

Edit summary for version 10 by Baxter:
New Python implementation by user [Baxter]

Version 9

2019-09-26, 14:19:58

Version 10

2019-09-26, 15:37:59

Idiom #185 Execute function in 30 seconds

Schedule the execution of f(42) in 30 seconds.

Idiom #185 Execute function in 30 seconds

Schedule the execution of f(42) in 30 seconds.

Extra Keywords
future
Extra Keywords
future
Imports
import threading
Code

  
def _f(x): 
    return x
  
timer = threading.Timer(30.0, _f, args=(42,) ) 
timer.start()