|
Author |
Topic: Speedometer / Framerate (Read 696 times) |
|
Euskadi
|
Speedometer / Framerate
« on: Feb 1st, 2004, 4:02pm » |
|
I asked in another forum about timing the speed of a sketch and learned about framerate() which returns the recent framerate if you leave the () empty. I wanted to visualize the framerate so I created a speedometer - this is what I came up with. I would be interested in knowing if the variance in framerate/target fps is due to the framerate() measurement or actual variations in speed. Well, at least I see varations [xp, intel p4 2 gig, p5=067]. The first speedo shows framerate with a target and redline at 60 fps. The other two just increment and are there to show different height/width ratios. If I get ambitious I might add a slider to follow the bezier and allow the user to move the redline... but for now this is it. http://www.shiftcenter.com/speedometer/applet/index.html
|
|
|
|
REAS
|
Re: Speedometer / Framerate
« Reply #1 on: Feb 1st, 2004, 9:22pm » |
|
For your information: This may seem strange, but I think we're going to change the functionality of framerate(). The "returning the current framerate" is not documented because it may not stay. It's very odd in a language to have a function which "returns" something part of the time and "returns" nothing other times. It might change to getFramerate() for example, and framerate() will remain the function for setting the maximum speed. + Casey
|
|
|
|
Euskadi
|
Re: Speedometer / Framerate
« Reply #2 on: Feb 1st, 2004, 10:04pm » |
|
I agree that it's odd to have 2 functions with the same name that may or may not return something. I orginally thought that framerate() would return the current setting... for example: framerate(20); // NOTE -- THIS DOESN'T WORK THIS WAY println(framerate()); // prints "20" You might consider this as an alternative, since people might want to get busy with the framerate without creating a variable to track their changes. Thanks for the FYI!
|
|
|
|
|