return gs_perfCounter.freq.QuadPart;
#endif // __WXMSW__
+#ifdef HAVE_GETTIMEOFDAY
+ // With gettimeofday() we can have nominally microsecond precision and
+ // while this is not the case in practice, it's still better than
+ // millisecond.
+ return MICROSECONDS_PER_SECOND;
+#else // !HAVE_GETTIMEOFDAY
// Currently milliseconds are used everywhere else.
return MILLISECONDS_PER_SECOND;
+#endif // HAVE_GETTIMEOFDAY/!HAVE_GETTIMEOFDAY
}
void wxStopWatch::Start(long t0)
}
#endif // __WXMSW__
- return wxGetLocalTimeMillis();
+#ifdef HAVE_GETTIMEOFDAY
+ return wxGetUTCTimeUSec();
+#else // !HAVE_GETTIMEOFDAY
+ return wxGetUTCTimeMillis();
+#endif // HAVE_GETTIMEOFDAY/!HAVE_GETTIMEOFDAY
}
wxLongLong wxStopWatch::TimeInMicro() const
// starts the global timer
void wxStartTimer()
{
- wxStartTime = wxGetLocalTimeMillis();
+ wxStartTime = wxGetUTCTimeMillis();
}
// Returns elapsed time in milliseconds
long wxGetElapsedTime(bool resetTimer)
{
wxLongLong oldTime = wxStartTime;
- wxLongLong newTime = wxGetLocalTimeMillis();
+ wxLongLong newTime = wxGetUTCTimeMillis();
if ( resetTimer )
wxStartTime = newTime;