Functions

# Time
[Functions and Macros by Category]

## Detailed Description

The functions in this section deal with getting the current time and sleeping for the specified time interval.

## Functions
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.
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)

## Function Documentation

long wxGetLocalTime | ( |  | ) |

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

See also:
  wxDateTime::Now()

Include file:

    #include <wx/stopwatch.h>

wxLongLong wxGetLocalTimeMillis | ( |  | ) |

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

See also:
  wxDateTime::Now(), wxLongLong

Include file:

    #include <wx/stopwatch.h>

long wxGetUTCTime | ( |  | ) |

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

See also:
  wxDateTime::Now()

Include file:

    #include <wx/stopwatch.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 | ) |

Deprecated:
  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.

Sleeps for the specified number of milliseconds.

Include file:

    #include <wx/utils.h>

|  | [ top ]