time functionsthe 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
::wxgetelapsedtimelong 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>
::wxgetlocaltimelong wxgetlocaltime() returns the number of seconds since local time 00:00:00 jan 1st 1970. see also include files <wx/timer.h>
::wxgetlocaltimemilliswxlonglong wxgetlocaltimemillis() returns the number of milliseconds since local time 00:00:00 jan 1st 1970. see also include files <wx/timer.h>
::wxgetutctimelong wxgetutctime() returns the number of seconds since gmt 00:00:00 jan 1st 1970. see also include files <wx/timer.h>
::wxmicrosleepvoid 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>
::wxmillisleepvoid 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>
::wxnowwxstring wxnow() returns a string representing the current date and time. include files <wx/utils.h>
::wxsleepvoid wxsleep(int secs) sleeps for the specified number of seconds. include files <wx/utils.h>
::wxstarttimervoid wxstarttimer() starts a stopwatch; use ::wxgetelapsedtime to get the elapsed time. see also wxtimer. include files <wx/timer.h>
::wxusleepvoid 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.
|