Class for cpu time benchmarking.
More...
Class for cpu time benchmarking.
Usage:
sleep(1);
BOOST_REQUIRE_CLOSE(t.
getwct(),1.0,20.0);
sleep(1);
sleep(1);
BOOST_REQUIRE_CLOSE(t.
getwct(),2.0,20.0);
BOOST_REQUIRE_CLOSE(t.
getwct(),0.0,20.0);
Class for cpu time benchmarking.
void stop()
Stop the timer.
double getcputime()
Return the cpu time.
void reset()
Reset the timer.
void start()
Start the timer.
double getwct()
Return the elapsed real time.
Definition at line 27 of file timer.hpp.
#include <timer.hpp>
|
| timer () |
| Default constructor.
|
|
void | start () |
| Start the timer.
|
|
void | stop () |
| Stop the timer.
|
|
double | getwct () |
| Return the elapsed real time.
|
|
double | getcputime () |
| Return the cpu time.
|
|
void | reset () |
| Reset the timer.
|
|
|
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
|
|
◆ timer()
Default constructor.
Definition at line 80 of file timer.hpp.
◆ check()
◆ getcputime()
double timer::getcputime |
( |
| ) |
|
|
inline |
Return the cpu time.
Definition at line 142 of file timer.hpp.
◆ getwct()
Return the elapsed real time.
Definition at line 130 of file timer.hpp.
◆ reset()
◆ start()
Start the timer.
Definition at line 90 of file timer.hpp.
◆ stop()
◆ cstart
start time from epoch
Definition at line 36 of file timer.hpp.
◆ cstop
stop time from epoch
Definition at line 42 of file timer.hpp.
◆ running
Flag that indicate if the timer is running or not.
Definition at line 30 of file timer.hpp.
◆ tsstart
struct timespec timer::tsstart |
|
private |
◆ tsstop
struct timespec timer::tsstop |
|
private |
The documentation for this class was generated from the following file: