All Samples(19) | Call(0) | Derive(18) | Import(1)
Call a function after a specified number of seconds:
t = Timer(30.0, f, args=[], kwargs={})
t.start()
t.cancel() # stop the timer's action if it's still waitingsrc/t/h/threading2-0.1.4/threading2/t2_base.py threading2(Download)
import threading2
from threading import *
from threading import _RLock,_Event,_Condition,_Semaphore,_BoundedSemaphore, \
_Timer,ThreadError,_time,_sleep,_get_ident,_allocate_lock
class Timer(_Timer):
"""Re-implemented Timer class.
Actually there's nothing new here, it just exposes the Timer class from
the stdlib as a normal class in case you want to extend it.
"""
pass
src/s/k/skink-HEAD/skink/lib/cherrypy/process/plugins.py skink(Download)
class PerpetualTimer(threading._Timer):
"""A subclass of threading._Timer whose run() method repeats."""
def run(self):
while True:
self.finished.wait(self.interval)
if self.finished.isSet():
src/f/o/Forban-HEAD/lib/ext/cherrypy/process/plugins.py Forban(Download)
class PerpetualTimer(threading._Timer):
"""A subclass of threading._Timer whose run() method repeats."""
def run(self):
while True:
self.finished.wait(self.interval)
if self.finished.isSet():
src/b/e/benchit-HEAD/trunk/lib/cherrypy/process/plugins.py benchit(Download)
class PerpetualTimer(threading._Timer):
"""A subclass of threading._Timer whose run() method repeats."""
def run(self):
while True:
self.finished.wait(self.interval)
if self.finished.isSet():
src/p/r/productiontrack-HEAD/pt1/tools/cherrypy/process/plugins.py productiontrack(Download)
class PerpetualTimer(threading._Timer):
"""A subclass of threading._Timer whose run() method repeats."""
def run(self):
while True:
self.finished.wait(self.interval)
if self.finished.isSet():
src/k/l/klappstuhl-HEAD/trunk/server/KlappStuhlDaemon/lib/Scheduler.py klappstuhl(Download)
class Task(threading._Timer):
def __init__(self, *args, **kwargs):
threading._Timer.__init__(self, *args, **kwargs)
self.setDaemon(True)
def run(self):
while True:
src/b/e/benchit-HEAD/lib/cherrypy/process/plugins.py benchit(Download)
class PerpetualTimer(threading._Timer):
"""A subclass of threading._Timer whose run() method repeats."""
def run(self):
while True:
self.finished.wait(self.interval)
if self.finished.isSet():
src/t/u/tux-droid-HEAD/software_suite_v2/software/scripts/nestor/nestor.py tux-droid(Download)
class PerpetualTimer(threading._Timer):
def run(self):
while True:
self.finished.wait(self.interval)
if self.finished.isSet():
return
src/p/r/productiontrack-HEAD/tools/cherrypy/process/plugins.py productiontrack(Download)
class PerpetualTimer(threading._Timer):
"""A subclass of threading._Timer whose run() method repeats."""
def run(self):
while True:
self.finished.wait(self.interval)
if self.finished.isSet():
src/k/l/klappstuhl-HEAD/server/KlappStuhlDaemon/lib/Scheduler.py klappstuhl(Download)
class Task(threading._Timer):
def __init__(self, *args, **kwargs):
threading._Timer.__init__(self, *args, **kwargs)
self.setDaemon(True)
def run(self):
while True:
1 | 2 Next