![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Class FunctionTimer measures the time it takes to execute a function. More...
#include <shambase/include/shambase/time.hpp>
Public Member Functions | |
| template<class Func > | |
| void | time_func (Func &&f) |
| Measures the time it takes to execute a function. | |
| f64 | func_time_sec () |
| Returns the average time it takes to execute the function. | |
Class FunctionTimer measures the time it takes to execute a function.
The class FunctionTimer is used to measure the time it takes to execute a function. It does this by creating a Timer object and starting it before executing the function. After the function has been executed, the timer is stopped and the elapsed time is added to the total time. The total time is then divided by the number of times the function has been executed to give the average time it takes to execute the function.
|
inline |