![]() |
Libftpp
A modern C++ library
|
Chronometre class for measuring elapsed time between start and end timestamps. It provides methods to retrieve the elapsed time in various units (nanoseconds, microseconds, milliseconds, seconds) and as a formatted string. More...
#include <chronometre.hpp>
Public Member Functions | |
| Chronometre ()=default | |
| ~Chronometre () | |
| void | start () |
| Start the chronometre. More... | |
| void | end () |
| End the chronometre. More... | |
| void | popLastChrono () |
| Remove the last recorded time interval (start and end timestamps). More... | |
| double | getTimeNanoseconds () const |
| Get the elapsed time in nanoseconds between the last start and end timestamps. More... | |
| double | getTimeMicroseconds () const |
| Get the elapsed time in microseconds between the last start and end timestamps. More... | |
| double | getTimeMilliseconds () const |
| Get the elapsed time in milliseconds between the last start and end timestamps. More... | |
| double | getTimeSeconds () const |
| Get the elapsed time in seconds between the last start and end timestamps. More... | |
| std::string | getTimeString () const |
| Get the elapsed time as a formatted string with appropriate units. More... | |
Chronometre class for measuring elapsed time between start and end timestamps. It provides methods to retrieve the elapsed time in various units (nanoseconds, microseconds, milliseconds, seconds) and as a formatted string.
Definition at line 26 of file chronometre.hpp.
|
default |
| Chronometre::~Chronometre | ( | ) |
Definition at line 3 of file chronometre.cpp.
| void Chronometre::end | ( | ) |
End the chronometre.
Definition at line 25 of file chronometre.cpp.
| double Chronometre::getTimeMicroseconds | ( | ) | const |
Get the elapsed time in microseconds between the last start and end timestamps.
Definition at line 61 of file chronometre.cpp.
| double Chronometre::getTimeMilliseconds | ( | ) | const |
Get the elapsed time in milliseconds between the last start and end timestamps.
Definition at line 73 of file chronometre.cpp.
| double Chronometre::getTimeNanoseconds | ( | ) | const |
Get the elapsed time in nanoseconds between the last start and end timestamps.
Definition at line 49 of file chronometre.cpp.
| double Chronometre::getTimeSeconds | ( | ) | const |
Get the elapsed time in seconds between the last start and end timestamps.
Definition at line 85 of file chronometre.cpp.
| std::string Chronometre::getTimeString | ( | ) | const |
Get the elapsed time as a formatted string with appropriate units.
Definition at line 98 of file chronometre.cpp.
| void Chronometre::popLastChrono | ( | ) |
Remove the last recorded time interval (start and end timestamps).
Definition at line 36 of file chronometre.cpp.
| void Chronometre::start | ( | ) |
Start the chronometre.
Definition at line 17 of file chronometre.cpp.