Sleipnir C++ API
Loading...
Searching...
No Matches
slp::ScopedTimeTracer< Tracer > Class Template Reference

#include </home/runner/work/Sleipnir/Sleipnir/include/sleipnir/util/time_tracer.hpp>

Public Member Functions

 ScopedTimeTracer (Tracer &tracer) noexcept
 
 ~ScopedTimeTracer ()
 Stops a tracer.
 
 ScopedTimeTracer (ScopedTimeTracer &&rhs) noexcept
 
 ScopedTimeTracer (const ScopedTimeTracer &)=delete
 
ScopedTimeTracer & operator= (const ScopedTimeTracer &)=delete
 
void stop ()
 
const std::chrono::duration< double > & current_duration () const
 

Detailed Description

template<TimeTracer Tracer>
class slp::ScopedTimeTracer< Tracer >

Starts a tracer in the constructor and stops it in the destructor.

Template Parameters
TracerTime tracer type.

Constructor & Destructor Documentation

◆ ScopedTimeTracer() [1/2]

template<TimeTracer Tracer>
slp::ScopedTimeTracer< Tracer >::ScopedTimeTracer ( Tracer &  tracer)
inlineexplicitnoexcept

Starts a tracer.

Parameters
tracerThe tracer.

◆ ScopedTimeTracer() [2/2]

template<TimeTracer Tracer>
slp::ScopedTimeTracer< Tracer >::ScopedTimeTracer ( ScopedTimeTracer< Tracer > &&  rhs)
inlinenoexcept

Move constructor.

Parameters
rhsThe other ScopedTimeTracer.

Member Function Documentation

◆ current_duration()

template<TimeTracer Tracer>
const std::chrono::duration< double > & slp::ScopedTimeTracer< Tracer >::current_duration ( ) const
inline

Returns the tracer's most recent solve duration in seconds.

Returns
The tracer's most recent solve duration in seconds.

◆ stop()

template<TimeTracer Tracer>
void slp::ScopedTimeTracer< Tracer >::stop ( )
inline

Stops the tracer.

If this is called, the destructor is a no-op.


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