Running a timer for function which will be called later (python) -


def child_thread(i):     global lock      while true:         try:             lock.acquire()                 f1()                 f2()                 f3()         :             lock.release()  thread1 = threading.thread(target=child_thread, args=(0,)) thread1.start() 

here need timer f2 function called.were thread should wait time. dont want use sleep.

the function call after 30.0 seconds

from threading import timer  def hello():     print "hello, world"  t = timer(30.0, hello) t.start() 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -