#include <UtilTime.hpp>
Public Member Functions | |
unsigned long | getElapsedTime () |
get the elapsed time | |
void | updateElapsedTimer () |
update the time duration watcher | |
UtilTime () | |
Default Constructor. | |
virtual | ~UtilTime () |
Destructor. | |
Static Public Member Functions | |
static unsigned long | getTicks () |
get the current number of cpu ticks in usecs | |
static int | nanoSleep (int nanoSecs) |
sleep a number of nanoseconds | |
static int | nanoSleepSecs (int seconds) |
sleep a number of seconds | |
static void | sleep (float Seconds) |
sleep a number of seconds (expressed as a float) |
This class provides static time routines for sleeping and finding the current time
It also can be instantiated to provide a time duration watcher
Definition at line 54 of file UtilTime.hpp.
unsigned long UtilTime::getElapsedTime | ( | ) |
get the elapsed time
Get time since last update.
Get the elapsed time since last update and update the timer if desired
Definition at line 82 of file UtilTime.cpp.
References getTicks().
unsigned long UtilTime::getTicks | ( | ) | [static] |
get the current number of cpu ticks in usecs
Definition at line 66 of file UtilTime.cpp.
Referenced by getElapsedTime(), and updateElapsedTimer().
int UtilTime::nanoSleep | ( | int | nanoSecs | ) | [static] |
sleep a number of nanoseconds
wrapper for nanosleep
nanoSecs | Time to sleep in nanoseconds |
Definition at line 93 of file UtilTime.cpp.
Referenced by H::FileEventWatcher::addFileToWatch().
int UtilTime::nanoSleepSecs | ( | int | nanoSecs | ) | [static] |
sleep a number of seconds
wrapper for nanosleep which sleeps in seconds
Definition at line 113 of file UtilTime.cpp.
void UtilTime::sleep | ( | float | Seconds | ) | [static] |
sleep a number of seconds (expressed as a float)
Sleep a number of seconds (wrapper for nanosleep).
Seconds | Time to sleep in seconds |
Definition at line 133 of file UtilTime.cpp.
Referenced by H::SocketServer::shutdown().
void UtilTime::updateElapsedTimer | ( | ) |
update the time duration watcher
Update the time duration watcher
Definition at line 149 of file UtilTime.cpp.
References getTicks().
Referenced by UtilTime().