// Purpose: Implementation of time-related functions.
// Author: Vadim Zeitlin
// Created: 2011-11-26
-// RCS-ID: $Id: wxhead.cpp,v 1.11 2010-04-22 12:44:51 zeitlin Exp $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// Get local time as milliseconds since 00:00:00, Jan 1st 1970
wxLongLong wxGetUTCTimeMillis()
{
- wxLongLong val = MILLISECONDS_PER_SECOND;
-
// If possible, use a function which avoids conversions from
// broken-up time structures to milliseconds
#if defined(__WINDOWS__)
t /= 10000;
t -= wxLL(11644473600000); // Unix - Windows epochs difference in ms.
return t;
-#elif defined(HAVE_GETTIMEOFDAY)
+#else // !__WINDOWS__
+ wxLongLong val = MILLISECONDS_PER_SECOND;
+
+#if defined(HAVE_GETTIMEOFDAY)
struct timeval tp;
if ( wxGetTimeOfDay(&tp) != -1 )
{
val *= wxGetUTCTime();
return val;
#endif // time functions
+
+#endif // __WINDOWS__/!__WINDOWS__
}
wxLongLong wxGetLocalTimeMillis()