## Time functions

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
::wxNow
::wxSleep
::wxStartTimer
::wxUsleep

### ::wxGetElapsedTime

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>

### ::wxGetLocalTime

long wxGetLocalTime()

Returns the number of seconds since local time 00:00:00 Jan 1st 1970.

See also

wxDateTime::Now

Include files

<wx/timer.h>

### ::wxGetLocalTimeMillis

wxLongLong wxGetLocalTimeMillis()

Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.

See also

wxDateTime::Now,
wxLongLong

Include files

<wx/timer.h>

### ::wxGetUTCTime

long wxGetUTCTime()

Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.

See also

wxDateTime::Now

Include files

<wx/timer.h>

### ::wxNow

wxString wxNow()

Returns a string representing the current date and time.

Include files

<wx/utils.h>

### ::wxSleep

void wxSleep(int secs)

Sleeps for the specified number of seconds.

Include files

<wx/utils.h>

### ::wxStartTimer

void wxStartTimer()

Starts a stopwatch; use ::wxGetElapsedTime to get the elapsed time.

See also wxTimer.

Include files

<wx/timer.h>

### ::wxUsleep

void wxUsleep(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>