GageTimer

What should I do instead? Just sit in a tight loop I guess… I think I’ll stick with Gage HiResTimer if it allows me to use standard API. :wink:

Don’t sit in a “tight” loop - sit in an OS-friendly loop:


while (timeNow < desiredTime) {
Thread.yield();
timeNow = getCurrentTime();
}

This is what I use in AF (regardless of whether I have vsync or not) and it works like a charm.

Cas :slight_smile:

If you look at the GAGETimer source, you’ll find that it does the exact same thing that PrinceC has posted. That method does use 100% CPU, but it plays nice with other applications and is the most accurate method currently available.