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. More... | |
long | wxGetLocalTime () |
Returns the number of seconds since local time 00:00:00 Jan 1st 1970. More... | |
wxLongLong | wxGetLocalTimeMillis () |
Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970. More... | |
long | wxGetUTCTime () |
Returns the number of seconds since GMT 00:00:00 Jan 1st 1970. More... | |
wxLongLong | wxGetUTCTimeMillis () |
Returns the number of milliseconds since GMT 00:00:00 Jan 1st 1970. More... | |
wxLongLong | wxGetUTCTimeUSec () |
Returns the number of microseconds since GMT 00:00:00 Jan 1st 1970. More... | |
void | wxMicroSleep (unsigned long microseconds) |
Sleeps for the specified number of microseconds. More... | |
void | wxMilliSleep (unsigned long milliseconds) |
Sleeps for the specified number of milliseconds. More... | |
wxString | wxNow () |
Returns a string representing the current date and time. More... | |
void | wxSleep (int secs) |
Sleeps for the specified number of seconds. More... | |
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 | ( | ) |
Returns the difference between UTC and local time in seconds.
Include file:
#include <wx/time.h>
long wxGetUTCTime | ( | ) |
Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.
Include file:
#include <wx/time.h>
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 | ( | ) |
Returns a string representing the current date and time.
Include file:
#include <wx/utils.h>
void wxSleep | ( | int | secs | ) |
Sleeps for the specified number of seconds.
Include file:
#include <wx/utils.h>
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>