High resolution timer via C++ ?

BlitzMax Forums/BlitzMax Programming/High resolution timer via C++ ?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

My code will return 0 if high resolution timers are not supported. Nowadays, it will be very rare to find a machine that doesn't support them. I'm not even sure if there is a DirectX7 capable machine that doesn't also support high resolution timers, so you should be safe with them.
If you want to be extra sure, you could always test first and set a flag.
Local HRFlag:Int = True
local TestTime:Long = GetTicks()
If Not TestTime Then HRFlag = False

While GameIsRunning
    Local Time:Double
    If HRFlag
        Time = GetMillisecs() 'Call High Resolution Timer
    Else
        Time = Millisecs() 'Call BMax Timer
    End If
Wend