//////////////////////////////////////////////////////////////
// ms_timer() = 'timer()'-like function for milliseconds
//////////////////////////////////////////////////////////////
// Usage:
// ms_timer(1); //reset timer to zero
// var xxx = ms_timer(0); //retrieve milliseconds since last reset
//////////////////////////////////////////////////////////////
//
long __stdcall GetTickCount();
#define PRAGMA_API GetTickCount;kernel32!GetTickCount
long ms_timer(var init)
{ static long StartTime = GetTickCount();
if(init) StartTime = GetTickCount();
return(GetTickCount() - StartTime);
}
//
//////////////////////////////////////////////////////////////