26#if defined(USE_PLF_TIMER)
27 #include <plf_nanotimer.h>
38#if defined(USE_PLF_TIMER)
41 std::chrono::steady_clock::time_point t_start;
52#if defined(USE_PLF_TIMER)
55 t_start = std::chrono::steady_clock::now();
66#if defined(USE_PLF_TIMER)
69 auto t_end = std::chrono::steady_clock::now();
71 std::chrono::duration_cast<std::chrono::nanoseconds>(t_end - t_start).count());
81 return sham::format(
"{:.2f} {}s", res.value, res.prefix);
double f64
Alias for double.
plf::nanotimer timer
Internal timer.
std::string get_time_str() const
Converts the stored nanosecond time to a string representation.
Timer()
Constructor, init nanosec to 0.
f64 elapsed_sec() const
Converts the stored nanosecond time to a floating point representation in seconds.
void start()
Starts the timer.
void stop()
Stops the timer and stores the elapsed time in nanoseconds.
f64 nanosec
Time in nanoseconds.
human_readable_t to_human_readable(double value)
Convert a raw value to a human-readable scaled form with an SI prefix.
namespace for basic c++ utilities