Change wxGetCurrentUTime as wxGetCurrentMTime (milli not micro!)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Sylvain Bougnoux
1999-09-29 19:51:04 +00:00
parent f0599ea919
commit 4f3ac40926
2 changed files with 9 additions and 9 deletions

View File

@@ -46,7 +46,7 @@ bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
long WXDLLEXPORT wxGetCurrentTime(); long WXDLLEXPORT wxGetCurrentTime();
// Get number of milliseconds since 00:00:00 GMT, Jan 1st 1970. // Get number of milliseconds since 00:00:00 GMT, Jan 1st 1970.
long WXDLLEXPORT wxGetCurrentUTime(); long WXDLLEXPORT wxGetCurrentMTime();
#endif #endif
// _WX_TIMER_H_BASE_ // _WX_TIMER_H_BASE_

View File

@@ -73,14 +73,14 @@ extern "C" int gettimeofday(struct timeval *tp, void *);
long wxStartTime = 0; long wxStartTime = 0;
void wxStartTimer(void) void wxStartTimer(void)
{ {
wxStartTime=wxGetCurrentUTime(); wxStartTime=wxGetCurrentMTime();
} }
// Returns elapsed time in milliseconds // Returns elapsed time in milliseconds
long wxGetElapsedTime(bool resetTimer) long wxGetElapsedTime(bool resetTimer)
{ {
long oldTime = wxStartTime; long oldTime = wxStartTime;
long newTime=wxGetCurrentUTime(); long newTime=wxGetCurrentMTime();
if (resetTimer) wxStartTime = newTime; if (resetTimer) wxStartTime = newTime;
return newTime - oldTime; return newTime - oldTime;
@@ -90,11 +90,11 @@ long wxGetElapsedTime(bool resetTimer)
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970. // Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
long wxGetCurrentTime(void) long wxGetCurrentTime(void)
{ {
return wxGetCurrentUTime()/1000; return wxGetCurrentMTime()/1000;
} }
// return GMT time in millisecond // return GMT time in millisecond
long wxGetCurrentUTime() long wxGetCurrentMTime()
{ {
#if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || \ #if defined(__xlC__) || defined(__AIX__) || defined(__SVR4__) || defined(__SYSV__) || \
(defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__) (defined(__GNUWIN32__) && !defined(__MINGW32__)) // || defined(__AIXV3__)
@@ -132,25 +132,25 @@ wxChrono::wxChrono()
void wxChrono::Start(long t) void wxChrono::Start(long t)
{ {
m_t0=wxGetCurrentUTime()-t; m_t0=wxGetCurrentMTime()-t;
m_pause=0; m_pause=0;
} }
void wxChrono::Pause() void wxChrono::Pause()
{ {
m_pause=wxGetCurrentUTime()-m_t0; m_pause=wxGetCurrentMTime()-m_t0;
} }
void wxChrono::Resume() void wxChrono::Resume()
{ {
m_t0=wxGetCurrentUTime()-m_pause; m_t0=wxGetCurrentMTime()-m_pause;
m_pause=0; m_pause=0;
} }
long wxChrono::Time() long wxChrono::Time()
{ {
if (m_pause) return m_pause; if (m_pause) return m_pause;
return wxGetCurrentUTime()-m_t0; return wxGetCurrentMTime()-m_t0;
} }