Class for cpu time benchmarking.
More...
Class for cpu time benchmarking.
Usage:
sleep(1);
BOOST_REQUIRE_CLOSE(t.
getwct(),1.0,10.0);
sleep(1);
sleep(1);
BOOST_REQUIRE_CLOSE(t.
getwct(),2.0,10.0);
BOOST_REQUIRE_CLOSE(t.
getwct(),0.0,10.0);
Definition at line 25 of file timer.hpp.
#include <timer.hpp>
|
bool | running |
| Flag that indicate if the timer is running or not.
|
|
struct timespec | tsstart |
| starting time
|
|
clock_t | cstart |
| start time from epoch
|
|
struct timespec | tsstop |
|
clock_t | cstop |
| stop time from epoch
|
|
double timer::getcputime |
( |
| ) |
|
|
inline |
Return the cpu time.
Definition at line 120 of file timer.hpp.
Return the elapsed real time.
Definition at line 108 of file timer.hpp.
Start the timer.
Definition at line 73 of file timer.hpp.
Stop the timer.
Definition at line 97 of file timer.hpp.
The documentation for this class was generated from the following file: