X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c801d85f158c4cba50b588807daabdcbd0ed3853..dcd307ee1f13834bdfe43a0964db657bcd860142:/include/wx/timer.h diff --git a/include/wx/timer.h b/include/wx/timer.h index 3dbe809312..0dd07e0bed 100644 --- a/include/wx/timer.h +++ b/include/wx/timer.h @@ -1,13 +1,52 @@ -#ifndef __TIMERH_BASE__ -#define __TIMERH_BASE__ +#ifndef _WX_TIMER_H_BASE_ +#define _WX_TIMER_H_BASE_ -#if defined(__WINDOWS__) +#if defined(__WXMSW__) #include "wx/msw/timer.h" -#elif defined(__MOTIF__) -#include "wx/xt/timer.h" -#elif defined(__GTK__) +#elif defined(__WXMOTIF__) +#include "wx/motif/timer.h" +#elif defined(__WXGTK__) #include "wx/gtk/timer.h" +#elif defined(__WXQT__) +#include "wx/qt/timer.h" +#elif defined(__WXMAC__) +#include "wx/mac/timer.h" +#elif defined(__WXPM__) +#include "wx/os2/timer.h" +#elif defined(__WXSTUBS__) +#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 wxGetCurrentMTime(); + #endif - // __TIMERH_BASE__ + // _WX_TIMER_H_BASE_