• Advertisement
Sign in to follow this  


This topic is 3480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use a function from the following book:

By Ron Penton

// returns the miliseconds transcurred

// Windows gets the time since the system was started
// Linux gets the time since 1970

sint64 GetTimeMS() {
#ifdef WIN32
sint64 t;
QueryPerformanceCounter( (LARGE_INTEGER*)(&t) );
return t / g_win32counter.m_frequency;
struct timeval t;
sint64 s;
gettimeofday( &t, 0 );
s = t.tv_sec;
s *= 1000;
s += (t.tv_usec / 1000);
return s;

And for Seconds you can use:

sint64 GetTimeS() {
return GetTimeMS() / 1000;

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement