WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-15-2014, 12:44 PM
Ryan Ryan is offline
Member
 
Join Date: Mar 2013
Posts: 5
Using viz.starttimer to run 100 times per second

I need to have something run approximately 100 times per second, but using
viz.starttimer(0,0.01,viz.FOREVER) or viz.starttimer(0,0.001,viz.FOREVER) does not seem to work. I only seem to be able to have this run about 20 times per second, no matter how small I make the second parameter.

Is there another way?

Thanks
Reply With Quote
  #2  
Old 01-15-2014, 02:10 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The timer runs in Vizard's main loop which is in sync with display updates. If the frame rate is 60 then the fastest timer expiration is 1/60 of a second.

What is the frame rate shown in Vizard (press F4) and what do you want to update at 100 times/sec?
Reply With Quote
  #3  
Old 01-15-2014, 02:32 PM
Ryan Ryan is offline
Member
 
Join Date: Mar 2013
Posts: 5
We have a haptic device that is linked to an object that is moved around and are tracking the coordinates of that object for analysis.

I'm not at that computer now but I believe the refresh rate is 60.

Would I be guessing right to assume that part of the problem might be that my computer isn't fast enough to run through my code in less than 1/60 of a second? If it was faster, and could run through my code faster, I should be able to up my output from 20 per second to 60, correct?

Or, is there a better way to run a routine on a time interval like this that would allow me to execute my routine 100 times per second?

Thanks.
Reply With Quote
  #4  
Old 01-16-2014, 01:03 PM
Ryan Ryan is offline
Member
 
Join Date: Mar 2013
Posts: 5
Sorry I was a little confused.

I checked the frame rate by pressing F4 and found that depending on what I'm running the frame rate is different. I have one module where the frame rate is around 2.5, another where it is about 6, and another where it is around 20. All of these modules do the same types of things. They allow a user to move objects around through a haptic device (phantom omni).

It might be okay if we can't get the rate up to 100, but we need it as fast as we can get it.

I haven't been able to determine the reason why one module is running much faster than the other two. Any ideas?
Reply With Quote
  #5  
Old 01-17-2014, 04:02 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The frame rates you're getting are very low. If you go to Reference > Basic Concepts > Real Time Performance Concerns in the Vizard Help you'll see a description of Vizard's render stats. These stats can help determine what's causing the frame rate to drop.
Reply With Quote
  #6  
Old 01-22-2014, 08:24 AM
fordprefect fordprefect is offline
Member
 
Join Date: Oct 2012
Location: Vienna, Austria, Europe
Posts: 39
To answer the other part of your question - if you use the default for the second parameter you will get an execution with each frame, no matter what the frame rate is, which as Jeff said is the fastest you can get from this command:
Code:
viz.starttimer(0, numRepeats = viz.FOREVER)
or
viz.starttimer(0, viz.FASTEST_EXPIRATION, viz.FOREVER)
Best Regards,
Walter
__________________
21 is only half the truth.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VirusScan OnAccess Scan causes long loading times FlyingWren Vizard 0 10-06-2004 04:58 PM


All times are GMT -7. The time now is 12:38 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC