Changes in src/sas/sascalc/data_util/calcthread.py [a1b8fee:7432acb] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/data_util/calcthread.py
ra1b8fee r7432acb 4 4 # \brief Abstract class for defining calculation threads. 5 5 # 6 from __future__ import print_function7 6 8 7 import thread … … 296 295 """ 297 296 def __init__(self, n=20000): 298 print (thread.get_ident())297 print thread.get_ident() 299 298 self.starttime = clock() 300 299 self.done = False … … 308 307 self.work2.queue(n) 309 308 self.work3.queue(n) 310 print ("Expect updates from Main every second and from thread every 2.5 seconds")311 print ("")309 print "Expect updates from Main every second and from thread every 2.5 seconds" 310 print "" 312 311 self.work.ready(.5) 313 312 while not self.done: 314 313 sleep(1) 315 print ("Main thread %d at %.2f" % (thread.get_ident(),316 clock() - self.starttime) )314 print "Main thread %d at %.2f" % (thread.get_ident(), 315 clock() - self.starttime) 317 316 318 317 def update(self, i=0): 319 print ("Update i=%d from thread %d at %.2f" % (i, thread.get_ident(),320 clock() - self.starttime) )318 print "Update i=%d from thread %d at %.2f" % (i, thread.get_ident(), 319 clock() - self.starttime) 321 320 self.work.ready(2.5) 322 321 323 322 def complete(self, total=0.0): 324 print ("Complete total=%g from thread %d at %.2f" % (total,323 print "Complete total=%g from thread %d at %.2f" % (total, 325 324 thread.get_ident(), 326 clock() - self.starttime) )325 clock() - self.starttime) 327 326 self.done = True
Note: See TracChangeset
for help on using the changeset viewer.