]> git.saurik.com Git - wxWidgets.git/commitdiff
provide wxGetLocalTimeMillis() (returning double) even if wxUSE_LONGLONG==0
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 11 Feb 2006 16:38:28 +0000 (16:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 11 Feb 2006 16:38:28 +0000 (16:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/stopwatch.h
src/common/stopwatch.cpp

index 19d35a168b679313f93b7a86f32ba17135a6f861..75f789592b1860440847f955c52756c1b8a94f8b 100644 (file)
@@ -89,10 +89,14 @@ extern long WXDLLIMPEXP_BASE wxGetLocalTime();
 extern long WXDLLIMPEXP_BASE wxGetUTCTime();
 
 #if wxUSE_LONGLONG
-// Get number of milliseconds since local time 00:00:00 Jan 1st 1970
-extern wxLongLong WXDLLIMPEXP_BASE wxGetLocalTimeMillis();
+    typedef wxLongLong wxMilliClock_t;
+#else
+    typedef double wxMilliClock_t;
 #endif // wxUSE_LONGLONG
 
+// Get number of milliseconds since local time 00:00:00 Jan 1st 1970
+extern wxMilliClock_t WXDLLIMPEXP_BASE wxGetLocalTimeMillis();
+
 #define wxGetCurrentTime() wxGetLocalTime()
 
 #endif // _WX_STOPWATCH_H_
index cd13eb058882e55cee011b27bd59f164cbde7523..9cf9902ae13209acb5170364789ce4d6602c1e7e 100644 (file)
@@ -364,6 +364,13 @@ wxLongLong wxGetLocalTimeMillis()
 #endif // time functions
 }
 
-#endif // wxUSE_LONGLONG
+#else // !wxUSE_LONGLONG
+
+double wxGetLocalTimeMillis(void)
+{
+    return (double(clock()) / double(CLOCKS_PER_SEC)) * 1000.0;
+}
+
+#endif // wxUSE_LONGLONG/!wxUSE_LONGLONG