The functions in this section deal with getting the current time and starting/stopping the global timers. Please note that the timer functions are deprecated because they work with one global timer only and wxTimer and/or wxStopWatch classes should be used instead. For retrieving the current time, you may also use wxDateTime::Now or wxDateTime::UNow methods.
::wxGetElapsedTime
::wxGetLocalTime
::wxGetLocalTimeMillis
::wxGetUTCTime
::wxMicroSleep
::wxMilliSleep
::wxNow
::wxSleep
::wxStartTimer
::wxUsleep
long wxGetElapsedTime(bool resetTimer = true)
Gets the time in milliseconds since the last ::wxStartTimer.
If resetTimer is true (the default), the timer is reset to zero by this call.
See also wxTimer.
Include files
<wx/timer.h>
long wxGetLocalTime()
Returns the number of seconds since local time 00:00:00 Jan 1st 1970.
See also
Include files
<wx/timer.h>
wxLongLong wxGetLocalTimeMillis()
Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.
See also
Include files
<wx/timer.h>
long wxGetUTCTime()
Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.
See also
Include files
<wx/timer.h>
void wxMicroSleep(unsigned long microseconds)
Sleeps for the specified number of microseconds. The microsecond resolution may not, in fact, be available on all platforms (currently only Unix platforms with nanosleep(2) may provide it) in which case this is the same as wxMilliSleep(microseconds/1000).
Include files
<wx/utils.h>
void wxMilliSleep(unsigned long milliseconds)
Sleeps for the specified number of milliseconds. Notice that usage of this function is encouraged instead of calling usleep(3) directly because the standard usleep() function is not MT safe.
Include files
<wx/utils.h>
wxString wxNow()
Returns a string representing the current date and time.
Include files
<wx/utils.h>
void wxSleep(int secs)
Sleeps for the specified number of seconds.
Include files
<wx/utils.h>
void wxStartTimer()
Starts a stopwatch; use ::wxGetElapsedTime to get the elapsed time.
See also wxTimer.
Include files
<wx/timer.h>
void wxUsleep(unsigned long milliseconds)
This function is deprecated because its name is misleading: notice that the argument is in milliseconds, not microseconds. Please use either wxMilliSleep or wxMicroSleep depending on the resolution you need.