41 const __int64 DELTA_EPOCH_IN_MICROSECS = 11644473600000000;
51 __int32 tz_minuteswest;
56 int gettimeofday(
struct timeval *tv,
struct timezone *tz)
60 TIME_ZONE_INFORMATION tz_winapi;
63 ZeroMemory(&ft,
sizeof(ft));
64 ZeroMemory(&tz_winapi,
sizeof(tz_winapi));
66 GetSystemTimeAsFileTime(&ft);
68 tmpres = ft.dwHighDateTime;
70 tmpres |= ft.dwLowDateTime;
74 tmpres -= DELTA_EPOCH_IN_MICROSECS;
75 tv->tv_sec = (__int32)(tmpres*0.000001);
76 tv->tv_usec = (tmpres % 1000000);
103 Timestamp::Timestamp(): m_nullStream(&m_nullBuffer)
111 static struct timeval tv;
112 gettimeofday( &tv,
NULL );
113 return tv.tv_sec * 1000 + tv.tv_usec / 1000;
139 unsigned long hours = time / 3600000;
140 unsigned long mins = ( time % 3600000 ) / 60000;
141 unsigned long secs = ( time % 60000 ) / 1000;
142 unsigned long msecs = time % 1000;
146 sprintf( times,
"[%02lu:%02lu:%02lu %03lu] ", hours, mins, secs, msecs);
147 string result( times );
unsigned long m_startTime
The system at object instantiation.
void resetTimer()
Resets the internal timer.
unsigned long getElapsedTimeInMs() const
Returns the milliseconds since object creation.
double getCurrentTimeinS() const
Returns the current system time in seconds.
double getElapsedTimeInS() const
Returns the time since instantiation in seconds.
unsigned long getCurrentTimeInMs() const
Returns the current system time in milliseconds.
string getElapsedTime() const
Returns a string representation of the current timer value.