PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

CGapiTimer::GetActualFrameTime() confusion, or bug?

(Note/Edit: I rounded some values below).

Maybe I'm understanding CGapiTimer::GetActualFrameTime() wrong, but shouldn't it return the time it takes a CGapiApplication::ProcessNextFrame() to process in seconds?

Example:

If the game is running at 60fps, then there's 60 updates per second. This would mean that each frame takes 0.017 of a second to process, because 0.017 * 60 = 1, which is 1 second (60 frames per second, means it's processing 60 frames in 1 second).

This is the value I would expect CGapiTimer::GetActualFrameTime() to return. Instead, it's giving me some numbers which make no logical sense to me.

When I set my game to run at no specified fps, I get 600+ fps. CGapiTimer::GetActualFrameTime() should give me 0.0017 or a similar value. Instead, I get a value of approximately 1.44.

In conclusion, either I'm not understanding the function correctly, my math is way off, or the function is bugged. If it's either of the first two, I would appreciate an explanation so I can fix my obviously flawed logic. :)

Thanks in advance.
Hi,

GetActualFrameTime returns the time as milliseconds, not seconds.

Thus, if it returns 1.44, your application is running at 1/0,00144 = 694fps.
Johan wrote:Hi,

GetActualFrameTime returns the time as milliseconds, not seconds.

Thus, if it returns 1.44, your application is running at 1/0,00144 = 694fps.


Ah, milliseconds. *slaps self* time / 1000 = seconds. I do have a few suggestions, but I'll post those in the suggestions thread.