Factorize timercmm.cpp code
Added wxGetCurrentUtime Put extern declaration in wx/timer.h instead of wx/*/timer.h Added wxChrono class git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,22 +24,6 @@
|
||||
|
||||
class wxTimer;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global functions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/* Timer functions (milliseconds) */
|
||||
void wxStartTimer();
|
||||
|
||||
/* Gets time since last wxStartTimer or wxGetElapsedTime */
|
||||
long wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
/* EXPERIMENTAL: comment this out if it doesn't compile. */
|
||||
bool wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
/* Get number of seconds since 00:00:00 GMT, Jan 1st 1970. */
|
||||
long wxGetCurrentTime();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTimer
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -24,22 +24,6 @@
|
||||
|
||||
class wxTimer;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// global functions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/* Timer functions (milliseconds) */
|
||||
void wxStartTimer();
|
||||
|
||||
/* Gets time since last wxStartTimer or wxGetElapsedTime */
|
||||
long wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
/* EXPERIMENTAL: comment this out if it doesn't compile. */
|
||||
bool wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
/* Get number of seconds since 00:00:00 GMT, Jan 1st 1970. */
|
||||
long wxGetCurrentTime();
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTimer
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -49,16 +49,5 @@ private:
|
||||
* But you may need to modify timercmn.cpp.
|
||||
*/
|
||||
|
||||
// Timer functions (milliseconds)
|
||||
void WXDLLEXPORT wxStartTimer();
|
||||
// Gets time since last wxStartTimer or wxGetElapsedTime
|
||||
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
// EXPERIMENTAL: comment this out if it doesn't compile.
|
||||
bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetCurrentTime();
|
||||
|
||||
#endif
|
||||
// _WX_TIMER_H_
|
||||
|
@@ -44,16 +44,5 @@ protected:
|
||||
* But you may need to modify timercmn.cpp.
|
||||
*/
|
||||
|
||||
// Timer functions (milliseconds)
|
||||
void WXDLLEXPORT wxStartTimer();
|
||||
// Gets time since last wxStartTimer or wxGetElapsedTime
|
||||
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
// EXPERIMENTAL: comment this out if it doesn't compile.
|
||||
bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetCurrentTime();
|
||||
|
||||
#endif
|
||||
// _WX_TIMER_H_
|
||||
|
@@ -47,16 +47,5 @@ private:
|
||||
DECLARE_ABSTRACT_CLASS(wxTimer)
|
||||
};
|
||||
|
||||
// Timer functions (milliseconds)
|
||||
void WXDLLEXPORT wxStartTimer();
|
||||
// Gets time since last wxStartTimer or wxGetElapsedTime
|
||||
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
// EXPERIMENTAL: comment this out if it doesn't compile.
|
||||
bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetCurrentTime();
|
||||
|
||||
#endif
|
||||
// _WX_TIMERH_
|
||||
|
@@ -49,16 +49,5 @@ private:
|
||||
* But you may need to modify timercmn.cpp.
|
||||
*/
|
||||
|
||||
// Timer functions (milliseconds)
|
||||
void WXDLLEXPORT wxStartTimer();
|
||||
// Gets time since last wxStartTimer or wxGetElapsedTime
|
||||
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
// EXPERIMENTAL: comment this out if it doesn't compile.
|
||||
bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetCurrentTime();
|
||||
|
||||
#endif
|
||||
// _WX_TIMER_H_
|
||||
|
@@ -49,16 +49,5 @@ private:
|
||||
* But you may need to modify timercmn.cpp.
|
||||
*/
|
||||
|
||||
// Timer functions (milliseconds)
|
||||
void WXDLLEXPORT wxStartTimer();
|
||||
// Gets time since last wxStartTimer or wxGetElapsedTime
|
||||
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
// EXPERIMENTAL: comment this out if it doesn't compile.
|
||||
bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetCurrentTime();
|
||||
|
||||
#endif
|
||||
// _WX_TIMER_H_
|
||||
|
@@ -17,5 +17,36 @@
|
||||
#include "wx/stubs/timer.h"
|
||||
#endif
|
||||
|
||||
class wxChrono
|
||||
{
|
||||
public:
|
||||
wxChrono();
|
||||
|
||||
void Start(long t=0);
|
||||
void Pause();
|
||||
void Resume();
|
||||
|
||||
long Time();
|
||||
|
||||
private:
|
||||
long m_t0;
|
||||
long m_pause;
|
||||
};
|
||||
|
||||
// Timer functions (milliseconds)
|
||||
void WXDLLEXPORT wxStartTimer();
|
||||
|
||||
// Gets time since last wxStartTimer or wxGetElapsedTime
|
||||
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
// EXPERIMENTAL: comment this out if it doesn't compile.
|
||||
bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetCurrentTime();
|
||||
|
||||
// Get number of milliseconds since 00:00:00 GMT, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetCurrentUTime();
|
||||
|
||||
#endif
|
||||
// _WX_TIMER_H_BASE_
|
||||
|
Reference in New Issue
Block a user