#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.
double UTimer::elapsed | ( | ) | [inline] |
double UTimer::getElapsedTime | ( | ) |
Definition at line 90 of file UTimer.cpp.
double UTimer::now | ( | ) | [static] |
This method is used to get the time of the system right now.
Definition at line 73 of file UTimer.cpp.
double UTimer::restart | ( | ) | [inline] |
void UTimer::start | ( | ) |
This method starts the timer.
Definition at line 80 of file UTimer.cpp.
void UTimer::stop | ( | ) |
This method stops the timer.
Definition at line 85 of file UTimer.cpp.
double UTimer::ticks | ( | ) |
Definition at line 110 of file UTimer.cpp.
UTimer::UTILITE_DEPRECATED | ( | double | getInterval() | ) |
This method is used to get the interval time between stop() and the start().
struct timeval UTimer::startTimeRecorded_ [private] |
struct timeval UTimer::stopTimeRecorded_ [private] |