Wednesday, March 25, 2009

Measure Time In Milliseconds

Use the DWORD GetTickCount(void) function.
The return value is the number of milliseconds that have elapsed since the system was started.
Example Code:

DWORD dwStart = GetTickCount();

Stop if this has taken too long:

if( GetTickCount() - dwStart >= TIMELIMIT )
Cancel();

No comments:

Post a Comment