Sleipnir C++ API
Loading...
Searching...
No Matches
slp::SetupProfiler Class Reference

#include <sleipnir/util/setup_profiler.hpp>

Public Member Functions

 SetupProfiler (std::string_view name)
 
void start ()
 
void stop ()
 
const std::chrono::duration< double > & duration () const
 

Public Attributes

std::string name
 Name of measurement to show in diagnostics.
 

Detailed Description

Records the number of profiler measurements (start/stop pairs) and the average duration between each start and stop call.

Constructor & Destructor Documentation

◆ SetupProfiler()

slp::SetupProfiler::SetupProfiler ( std::string_view  name)
inlineexplicit

Constructs a SetupProfiler.

Parameters
nameName of measurement to show in diagnostics.

Member Function Documentation

◆ duration()

const std::chrono::duration< double > & slp::SetupProfiler::duration ( ) const
inline

Returns the setup duration in milliseconds as a double.

Returns
The setup duration in milliseconds as a double.

◆ start()

void slp::SetupProfiler::start ( )
inline

Tell the profiler to start measuring setup time.

◆ stop()

void slp::SetupProfiler::stop ( )
inline

Tell the profiler to stop measuring setup time.


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