Class for cpu time benchmarking. More...
#include <timer.hpp>
Public Member Functions | |
| timer () | |
| Default constructor. | |
| void | start () |
| Start the timer. More... | |
| void | stop () |
| Stop the timer. More... | |
| double | getwct () |
| Return the elapsed real time. More... | |
| double | getcputime () |
| Return the cpu time. More... | |
| void | reset () |
| Reset the timer. More... | |
Private Member Functions | |
| void | check () |
Private Attributes | |
| 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 | |
Class for cpu time benchmarking.
Usage:
|
inline |