|
Zip and Skip Tries
|
A timer class measuring wall-clock time using std::chrono::high_resolution_clock.
More...
#include <data.hpp>
Public Member Functions | |
| WallTimer ()=default | |
| Default constructor. | |
| size_t | elapsed_nanoseconds () const noexcept |
| Calculates the elapsed time since the timer was started. | |
| void | start (const std::string &prompt="", bool reset=true) noexcept |
| Starts or resets the timer and optionally prints a starting message. | |
| size_t | print () noexcept |
| Prints the elapsed time since the last start/reset to stdout. | |
Public Attributes | |
| std::chrono::high_resolution_clock::time_point | start_time |
A timer class measuring wall-clock time using std::chrono::high_resolution_clock.
Provides methods to start the timer, get the elapsed time, and print the elapsed time. Suitable for measuring the real time elapsed, including potential waits or system overhead.
|
default |
Default constructor.
|
inlinenoexcept |
Calculates the elapsed time since the timer was started.
Definition at line 126 of file data.hpp.
|
inlinenoexcept |
Prints the elapsed time since the last start/reset to stdout.
Calculates the elapsed time, formats it using pretty_print, and prints "done (formatted_time)\n".
Definition at line 158 of file data.hpp.
Starts or resets the timer and optionally prints a starting message.
| prompt | A message to print to stdout indicating what is being timed. If empty, no message is printed. |
| reset | If true (default), resets the start time. If false, keeps the previous start time (useful for cumulative timing). |
Definition at line 138 of file data.hpp.
| std::chrono::high_resolution_clock::time_point WallTimer::start_time |