![]() |
|
|
|
#1
|
|||
|
|||
|
Thanks for your reply!
Do you think the problem might also be reduced when I call the timer function in a new thread (i.e. viz. director(function))? Or would the vizard rendering loop still delay the output? |
|
#2
|
|||
|
|||
|
For high resolution timing values, you should use either viz.tick() or time.clock(). These functions will provide the number of seconds since the application started. If you need a high resolution representation of the actual time, then you can capture the current time at the beginning of your script and then add on the high resolution seconds to it at runtime. Here is an example:
Code:
import viz
import vizact
import datetime
viz.go()
# Get starting time and tick
startTime = datetime.datetime.now()
startTick = viz.tick()
def LogTime():
# Add elapsed seconds to starting time
curTime = startTime + datetime.timedelta(0,viz.tick()-startTick)
print curTime.strftime('%H:%M:%S:%f')
vizact.ontimer(0.1, LogTime)
|
|
#3
|
|||
|
|||
|
Thank you farshizzo for your detailed reply! I will try out your code as soon as possible and report back on the matter.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Head tracking logging & realtime data | tmcw | Vizard | 2 | 08-18-2007 10:31 AM |