RE: [info-performer] How to calculate change in Frame time.

Date view Thread view Subject view Author view

Harri.Mahonen++at++seamk.fi
Date: 02/03/2006 03:04:07


Hi,

> Is there any library utility for calculating change in Frame time
> (deltaFrameTime).

Simple way is to use pfGetTime. You need three variables: current time, last time and delta. Set all to zero.

1. At the beginning of the frame, get the current time with pfGetTime.
2. Calculate delta by (current time - last time) / 1000.0
3. Use the delta how you see fit.
4. At the end of the frame assign the current time you got at step 1 to last time.
5. Repeat.

This is what I use and it works. The very first frame's delta time is 0, but that isn't an issue (for my purposes, at least).


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Feb 03 2006 - 03:04:01 PST