File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ class Scheduler():
2121 It supports one special coroutine - the updatorCoroutine, which is invoked before and after all the other ones.
2222 '''
2323
24+ timeMillisBetweenWorkCalls = 50
25+
2426 @staticmethod
2527 def currentTimeMillis ():
2628 'Answers the time in floating point milliseconds since program start.'
@@ -29,7 +31,7 @@ def currentTimeMillis():
2931 return c .days * (3600.0 * 1000 * 24 ) + c .seconds * 1000.0 + c .microseconds / 1000.0
3032
3133 def __init__ (self , timeMillisBetweenWorkCalls = 50 ):
32- self .timeMillisBetweenWorkCalls = timeMillisBetweenWorkCalls
34+ Scheduler .timeMillisBetweenWorkCalls = timeMillisBetweenWorkCalls
3335 self .coroutines = []
3436 self .timeOfLastCall = Scheduler .currentTimeMillis ()
3537 self .updateCoroutine = self .nullCoroutine () # for testing - usually replaced.
@@ -145,7 +147,7 @@ def waitMilliseconds( timeMillis ):
145147
146148 @staticmethod
147149 def withTimeout ( timeoutMillis , * coroutineList ):
148- 'Coroutine that wraps the given coroutine with a timeout'
150+ 'Coroutine that wraps the given coroutine(s) with a timeout'
149151 return Scheduler .runTillFirstCompletes ( Scheduler .waitMilliseconds ( timeoutMillis ), * coroutineList )
150152
151153 @staticmethod
You can’t perform that action at this time.
0 commit comments