Get the execution between a block of code.
More...
#include <timer.hpp>
|
| Timer () |
| Initialize a Timer with the current time.
|
|
int64_t | nanoseconds () const |
| Return the number of nanoseconds elapsed since the start of the timer.
|
|
int64_t | milliseconds () const |
| Return the number of nanoseconds elapsed since the start of the timer.
|
|
double | seconds () const |
| Return the number of seconds elapsed since the start of the timer.
|
|
std::string | toString () const |
| Return the number of seconds elapsed since the start of the timer as a string.
|
|
|
void | start () |
| Manually sets the start time.
|
|
void | end () |
| Manually sets the end time.
|
|
Get the execution between a block of code.
Definition at line 12 of file timer.hpp.
◆ Timer()
Initialize a Timer with the current time.
Definition at line 34 of file timer.hpp.
◆ end()
Manually sets the end time.
Definition at line 27 of file timer.hpp.
◆ milliseconds()
int64_t Timer::milliseconds |
( |
| ) |
const |
|
inline |
Return the number of nanoseconds elapsed since the start of the timer.
Definition at line 61 of file timer.hpp.
◆ nanoseconds()
int64_t Timer::nanoseconds |
( |
| ) |
const |
|
inline |
Return the number of nanoseconds elapsed since the start of the timer.
Definition at line 43 of file timer.hpp.
◆ seconds()
double Timer::seconds |
( |
| ) |
const |
|
inline |
Return the number of seconds elapsed since the start of the timer.
Definition at line 70 of file timer.hpp.
◆ start()
Manually sets the start time.
Definition at line 22 of file timer.hpp.
◆ toString()
std::string Timer::toString |
( |
| ) |
const |
|
inline |
Return the number of seconds elapsed since the start of the timer as a string.
Definition at line 80 of file timer.hpp.
◆ _endTime
struct timespec Timer::_endTime |
|
private |
◆ _startTime
struct timespec Timer::_startTime |
|
private |
◆ NanosecondsPerSecond
constexpr int64_t Timer::NanosecondsPerSecond = 1000LL * 1000 * 1000 |
|
staticconstexprprivate |
The documentation for this class was generated from the following file: