]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxGetUTCTimeMillis() instead of wxGetLocalTimeMillis() in wxStopWatch.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Nov 2011 19:50:35 +0000 (19:50 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Nov 2011 19:50:35 +0000 (19:50 +0000)
Using local time meant that wxStopWatch didn't work reliably around DST
changes. It also was completely unnecessary, just use the UTC clock instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69840 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/stopwatch.cpp

index 476237c9cf18376f3d37dde4f653ded78ed54f32..b0e6ddde4085cdb0fec25f6363485044e9735baf 100644 (file)
@@ -134,7 +134,7 @@ wxLongLong wxStopWatch::GetCurrentClockValue() const
     }
 #endif // __WXMSW__
 
-    return wxGetLocalTimeMillis();
+    return wxGetUTCTimeMillis();
 }
 
 wxLongLong wxStopWatch::TimeInMicro() const
@@ -158,14 +158,14 @@ static wxLongLong wxStartTime = 0l;
 // 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;