Thread: Elapse timer
View Single Post
  #2  
Old 12-14-2005, 11:34 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

To calculate the elapsed time between two events, you need to save the start time using time.clock(). Once the event has ended take the current time using time.clock() again, and subtract the start time. This will give you the correct elapsed time. Here's some sample code:
Code:
#Save start of event
startTime = time.clock()
.
.
.
#Calculate elapsed time
elapsed = time.clock() - startTime
Reply With Quote