time/loopIterated = fps?

K.I.L.E.R

Retarded moron
Veteran
meh...

Making my benchmark proggie (a serious one) and I am just wandering about timers in C++ (I at least think I have it partially working one) and the fps calculation.
I am asking someone if they can explain the 'time/loopIterated = fps' part considering I am not using actual visual frames, more like iterations over a specific time to get a fps like result.

Also some hints and tips on timers as well as how you guys do it would be helpful.

Thanks
 
I use the highres timers in the CPU through the RDTSC instruction which counts number of cycles since boot. This way I can get the time it takes for a frame to be drawn. Can be used for speed calculation too. Fps is then 1 / time.
 
If you don't need an instantaneous graph then you can just do total iterations / duration of the run. The longer the run, the more accurate you get.
 
Thanks guys.

Himself = that is what I am currently doing albeit I am having logical toruble doing it. :)

Humus: Can you show me some of your code?
Am I allowed to 'borrow' your code as well? :LOL: :)
 
@kiler: If Im not mistaken all of Humus' code is under gpl. Where as long as you credit him, keep it open source, and dont try to make profit from part of his code, then you could use it.

later,
 
epicstruggle said:
@kiler: If Im not mistaken all of Humus' code is under gpl. Where as long as you credit him, keep it open source, and dont try to make profit from part of his code, then you could use it.

later,

I like to ask anyway. It is his work and it's much better to ask as it is polite. :)
I won't take it regardless if he doesn't want me to use it. Just out of being polite. :)
 
this is just me, but I find it particularly useful to have a minimum / maximum / mean output. That, however, may be a tad bit more difficult depending on how you originally calculated fps.
 
Sage said:
this is just me, but I find it particularly useful to have a minimum / maximum / mean output. That, however, may be a tad bit more difficult depending on how you originally calculated fps.

That won't work as I am not doing anything visual. I am taxing the CPU with massive amounts of equations and then outputing how long it had taken the CPU to do all those equations.

On a 486 it would take longer than on a P4 1.8GHz. My results should reflect that.
 
Back
Top