The functions in this section deal with getting the current time and sleeping for the specified time interval.
Functions | |
int | wxGetTimeZone () |
Returns the difference between UTC and local time in seconds. | |
long | wxGetLocalTime () |
Returns the number of seconds since local time 00:00:00 Jan 1st 1970. | |
wxLongLong | wxGetLocalTimeMillis () |
Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970. | |
long | wxGetUTCTime () |
Returns the number of seconds since GMT 00:00:00 Jan 1st 1970. | |
wxLongLong | wxGetUTCTimeMillis () |
Returns the number of milliseconds since GMT 00:00:00 Jan 1st 1970. | |
wxLongLong | wxGetUTCTimeUSec () |
Returns the number of microseconds since GMT 00:00:00 Jan 1st 1970. | |
void | wxMicroSleep (unsigned long microseconds) |
Sleeps for the specified number of microseconds. | |
void | wxMilliSleep (unsigned long milliseconds) |
Sleeps for the specified number of milliseconds. | |
wxString | wxNow () |
Returns a string representing the current date and time. | |
void | wxSleep (int secs) |
Sleeps for the specified number of seconds. | |
void | wxUsleep (unsigned long milliseconds) |
long wxGetLocalTime | ( | ) |
Returns the number of seconds since local time 00:00:00 Jan 1st 1970.
Include file:
#include <wx/time.h>
wxLongLong wxGetLocalTimeMillis | ( | ) |
Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.
The use of wxGetUTCTimeMillis() is preferred as it provides a usually (except for changes to the system time) monotonic clock which the local time also changes whenever DST begins or ends.
Include file:
#include <wx/time.h>
int wxGetTimeZone | ( | ) |
long wxGetUTCTime | ( | ) |
wxLongLong wxGetUTCTimeMillis | ( | ) |
Returns the number of milliseconds since GMT 00:00:00 Jan 1st 1970.
Include file:
#include <wx/time.h>
wxLongLong wxGetUTCTimeUSec | ( | ) |
Returns the number of microseconds since GMT 00:00:00 Jan 1st 1970.
Include file:
#include <wx/time.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 calling wxMilliSleep() with the argument of microseconds/1000.
Include file:
#include <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 file:
#include <wx/utils.h>
wxString wxNow | ( | ) |
void wxSleep | ( | int | secs | ) |
void wxUsleep | ( | unsigned long | milliseconds | ) |
Please use either wxMilliSleep() or wxMicroSleep() depending on the resolution you need.
Sleeps for the specified number of milliseconds.
Include file:
#include <wx/utils.h>