-    #define GetMillisecondsTime() _EVT_getTicks()
-#else
-    #define GetMillisecondsTime() wxGetLocalTimeMillis().ToLong()
-#endif
+    #define GetMillisecondsTime _EVT_getTicks
+
+    typedef ulong wxTimerTick_t;
+
+    #define wxTimerTickFmtSpec _T("lu")
+    #define wxTimerTickPrintfArg(tt) (tt)
+#else // !__WXMGL__
+    #define GetMillisecondsTime wxGetLocalTimeMillis
+
+    typedef wxLongLong wxTimerTick_t;
+
+    #if wxUSE_LONGLONG_WX
+        #define wxTimerTickFmtSpec wxLongLongFmtSpec _T("d")
+        #define wxTimerTickPrintfArg(tt) (tt.GetValue())
+    #else // using native wxLongLong
+        #define wxTimerTickFmtSpec _T("s")
+        #define wxTimerTickPrintfArg(tt) (tt.ToString().c_str())
+    #endif // wx/native long long
+#endif // __WXMGL__/!__WXMGL__