81 for (
u32 i = 0; i < relaunch; i++) {
155 for (
f64 i = start; i < end; i *= pow_exp) {
High-resolution timer with plf_nanotimer (non-macOS) or std::chrono (macOS) backend.
double f64
Alias for double.
std::uint32_t u32
32 bit unsigned integer
Class FunctionTimer measures the time it takes to execute a function.
f64 func_time_sec()
Returns the average time it takes to execute the function.
void time_func(Func &&f)
Measures the time it takes to execute a function.
Class Timer measures the time elapsed since the timer was started.
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.
namespace for basic c++ utilities
f64 timeitfor(Func &&f, f64 max_duration=1)
Measures the average time it takes to execute a function until a maximum duration is reached.
f64 timeit(Func &&f, u32 relaunch=1)
Measures the average time it takes to execute a function.
BenchmarkResult benchmark_pow_len(std::function< f64(u32)> func, u32 start, u32 end, f64 pow_exp)
Benchmark a function with input values following a power law.
Structure to store the results of a benchmark.
std::vector< f64 > counts
The counts of the benchmark.
std::vector< f64 > times
The times of the benchmark.