mal-packet-weaver
C++20 packet serialization/deserialization library.
|
A simple timer class for measuring elapsed time using various clock types. More...
#include "timer.hpp"
Public Member Functions | |
Timer () | |
Constructs a Timer and initializes it with the current time. | |
void | reset_to_now () |
Resets the start time to the current time. | |
void | reset () |
Resets the start time to the previously captured current time. | |
constexpr float | elapsed () noexcept |
Calculates and returns the elapsed time since the timer was last reset. | |
Private Attributes | |
std::chrono::time_point< clock > | start_ |
The time point representing the start time. | |
std::chrono::time_point< clock > | current_ |
The time point representing the current time. | |
A simple timer class for measuring elapsed time using various clock types.
This class provides the ability to measure elapsed time using different clock types (e.g., steady_clock, high_resolution_clock).
|
inline |
|
inlineconstexprnoexcept |
|
inline |
|
inline |
|
private |
|
private |