|
TEC
A lightweight C++ library enabling safe, efficient execution in multithreaded and concurrent systems.
|
A simple timer for measuring elapsed time. More...
#include <tec_utils.hpp>
Public Member Functions | |
| Timer () | |
| Constructs and starts a timer. | |
| void | start () |
| Starts or restarts the timer. | |
| Duration | stop () |
| Stops the timer and returns the elapsed time. | |
A simple timer for measuring elapsed time.
Measures the time elapsed between start and stop calls using a monotonic clock.
| Duration | The duration type for measurements (defaults to MilliSec). |
|
inline |
Constructs and starts a timer.
Initializes the timer and immediately starts it by recording the current time.
|
inline |
Starts or restarts the timer.
Records the current time as the timer's start point.
|
inline |
Stops the timer and returns the elapsed time.
Calculates the time elapsed since the last start() call.