Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Member Functions | List of all members
shambase::FunctionTimer Class Reference

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.
 

Detailed Description

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.

Definition at line 136 of file time.hpp.

Member Function Documentation

◆ func_time_sec()

f64 shambase::FunctionTimer::func_time_sec ( )
inline

Returns the average time it takes to execute the function.

Returns
f64 The average time it takes to execute the function.

Definition at line 163 of file time.hpp.

◆ time_func()

template<class Func >
void shambase::FunctionTimer::time_func ( Func &&  f)
inline

Measures the time it takes to execute a function.

Parameters
fThe function to be executed.

Definition at line 149 of file time.hpp.


The documentation for this class was generated from the following file: