#include <UTimer.h>
Public Member Functions | |
double | elapsed () |
double | getElapsedTime () |
double | restart () |
void | start () |
void | stop () |
double | ticks () |
UTILITE_DEPRECATED (double getInterval()) | |
UTimer () | |
~UTimer () | |
Static Public Member Functions | |
static double | now () |
Private Attributes | |
struct timeval | startTimeRecorded_ |
struct timeval | stopTimeRecorded_ |
This class is used to time some codes (in seconds). On Unix, the resolution is up to microseconds (see gettimeofday()). On Windows, the performance counter is used (see QueryPerformanceCounter() and QueryPerformanceFrequency()). Example:
UTimer::UTimer | ( | ) |
Definition at line 26 of file UTimer.cpp.
UTimer::~UTimer | ( | ) |
Definition at line 34 of file UTimer.cpp.
|
inline |
double UTimer::getElapsedTime | ( | ) |
Definition at line 97 of file UTimer.cpp.
|
static |
This method is used to get the time of the system right now.
Definition at line 80 of file UTimer.cpp.
|
inline |
void UTimer::start | ( | ) |
This method starts the timer.
Definition at line 87 of file UTimer.cpp.
void UTimer::stop | ( | ) |
This method stops the timer.
Definition at line 92 of file UTimer.cpp.
double UTimer::ticks | ( | ) |
Definition at line 117 of file UTimer.cpp.
UTimer::UTILITE_DEPRECATED | ( | double | getInterval() | ) |
This method is used to get the interval time between stop() and the start().