Module Tools
[hide private]
[frames] | no frames]

Source Code for Module Tools

 1  # Tools.py 
 2  # Remote mode 
 3   
 4  import time 
 5  import SharedConstants 
6 7 -class Tools():
8 - def __init__(self):
9 self.startTime = 0
10
11 - def startTimer(self):
12 self.startTime = time.clock()
13
14 - def getTime(self):
15 if self.startTime == 0: 16 return 0 17 else: 18 return int(1000 * (time.clock() - self.startTime))
19 20 @staticmethod
21 - def debug(text):
22 if SharedConstants.DEBUG: 23 print text
24 25 @staticmethod
26 - def delay(interval):
27 """ 28 Suspends execution for a given time inverval. 29 @param interval: the time interval in milliseconds (ms) 30 @return: none 31 """ 32 time.sleep(interval / 1000.0)
33