![]() |
|
|
|
#1
|
|||
|
|||
|
A timer starts whenever you call viz.starttimer(), so your goal is to decide when it's appropriate to make that call.
Something like this sketch (this is not tested code): Code:
timer_one = False def mytimer(num): if num == 0: if not timer_one and viz.get(viz.FRAME_TIMESTAMP) > 5.0: timer_one = True viz.starttimer(1, 0, viz.PERPETUAL) # do other timer-zero stuff if num == 1: # do other timer-one stuff viz.callback(viz.TIMER_EVENT, mytimer) viz.starttimer(0, 0.01, viz.FOREVER)
__________________
-- [ e d h a l l e y ] I'm just a user, not a representative of WorldViz. Hope I've been helpful. |
|
#2
|
|||
|
|||
|
error
when I try to run that I get this error:
if not timer_one and viz.get(viz.FRAME_TIMESTAMP) > 5.0: AttributeError: 'module' object has no attribute 'FRAME_TIMESTAMP' |
|
#3
|
|||
|
|||
|
You can also use the Python time module.
Code:
import time #Gives number of seconds since program start print time.clock()
__________________
Paul Elliott WorldViz LLC |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|