From: Bruce S. <bas...@nc...> - 2010-11-02 00:11:09
|
I don't think one has ever been able to depend on rate(x) giving you a precise rate of x iterations per second of a loop. The function of the rate function is just to clamp loop iterations not to exceed x iterations per second, so that when you run an animation on a very fast machine the animation still looks okay. The implementation of the rate function is that it looks at the time elapsed since it was last encountered. If this time is less than 1/x seconds, it waits for the remaining time to elapse (if the time elapsed is more than 1/x seconds, no pause is performed). The elapsed time, the measurement of the elapsed time, and the attempt to wait the remaining amount of time are all subject to the vagaries of the operating system. Bruce Sherwood On Mon, Nov 1, 2010 at 3:54 PM, Jason Morgan <jas...@vp...> wrote: > Hi, > > > > As I have mentioned before, I am working on a really cool program for > displaying lots of real time data graphically. > > > > I am now working away so I have turned to running the script on my laptop > (which admittedly is a reasonably powerful DTR, though not as powerful as my > desktop). > > > > My desktop runs at 125.0 fps pretty much bang on. (it’s a quad core 3GHz AMD > Phenom with a dual head Quadro graphics card running XP). > > > > But on my laptop the fps jumps all over the place, but centres on about 100 > fps. (This is a 3GHz dual core with a proper internal NVidia graphics card) > > > > Now, the script *HAS* to run at a rate of at least 111.11 fps or it breaks > as the streaming data starts to back up and cease to be real time. > > > > At first I thought perhaps my laptop was simply too slow to process the data > L - bum!! So I took out the rate(125) line, it went to 8k fps. Hum, can’t > be that then. > > > > So I change the rate(125) line to rate(150) and bingo it now works, with a > rate of about 148.0 fps. It is as though the calibration on the rate(x) > timer is a bit squiffy? > > > > Any clues? > > > > So, it looks like to make it portable I need a contiguous feedback > adjustment of the rate(x) – perhaps that feature should be part of the code? > > > > Cheers, > > Jason. > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |