Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Windows 7 - Timer (tier2)

Author
Message
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 24th Jun 2012 01:32
Hi guys,
I found some code about precision timer under Windows platform. Because I want to have the code portable, is it possible to simulate the following functions:

and

using the AppGameKit functions?

Thanks
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Jun 2012 01:47
What do these two functions report?

And what do you want to use them for?

There is a 'GetFrameTime' command that says how long, in seconds, the game took during the last sync cycle.

Personally, I absolutely hate the Windows performance monitor system and turn it off.

Cheers,
Ancient Lady
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 24th Jun 2012 01:58
Quote: "What do these two functions report?"

Wish I knew!!!

Quote: "There is a 'GetFrameTime' command..."

That's exactly what I am looking
Thanks Ancient Lady!
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 24th Jun 2012 02:04
The only reliable Windows timer is an MMTimer (multimedia timer) because a straight Timer is low down the priority food-chain. Actually, MMTimer depends on QueryPerformanceCounter but generates a signal when the period elapses.

But then, Windows' multi-tasking remains awful. Even on a big fat box it's inclined to stutter, and still doesn't come near what was possible on an Amiga.

I don't think that you can get this precision in a guaranteed way on all platforms, though it would be nice to be proved wrong!

-- Jim
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 24th Jun 2012 02:52 Edited at: 24th Jun 2012 02:53
I think a bit excessive.
The Amiga was an excellent machine but has spent much time since then, don't you think?
I read a few things about these functions and I think they are handy when the programmer needs to know a unique timing when a machine has two or more processors.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Jun 2012 03:28
The AppGameKit timer commands use QueryPerformanceCounter on Windows, and whatever suitable high precision timer exists on the various other platforms.
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 25th Jun 2012 06:20
Does the 'GetFrameTime' suffers from floating point inaccuracies as stated in the AppGameKit documentation?
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Jun 2012 17:31
Quote: "Does the 'GetFrameTime' suffers from floating point inaccuracies as stated in the AppGameKit documentation?"


The internal values used to calculate the frame time are doubles so have significantly less problems than the Timer() command.

Login to post a reply

Server time is: 2024-11-23 16:56:43
Your offset time is: 2024-11-23 16:56:43