WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
slp::ScopedProfiler< Profiler > Class Template Reference

Starts a profiler in the constructor and stops it in the destructor. More...

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/util/scoped_profiler.hpp>

Public Member Functions

 ScopedProfiler (Profiler &profiler) noexcept
 Starts a profiler.
 ~ScopedProfiler ()
 Stops a profiler.
 ScopedProfiler (ScopedProfiler &&rhs) noexcept
 Move constructor.
 ScopedProfiler (const ScopedProfiler &)=delete
ScopedProfileroperator= (const ScopedProfiler &)=delete
void stop ()
 Stops the profiler.
const std::chrono::duration< double > & current_duration () const
 Returns the most recent solve duration in milliseconds as a double.

Detailed Description

template<typename Profiler>
requires std::same_as<Profiler, SetupProfiler> || std::same_as<Profiler, SolveProfiler>
class slp::ScopedProfiler< Profiler >

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

Constructor & Destructor Documentation

◆ ScopedProfiler() [1/3]

template<typename Profiler>
slp::ScopedProfiler< Profiler >::ScopedProfiler ( Profiler & profiler)
inlineexplicitnoexcept

Starts a profiler.

Parameters
profilerThe profiler.

◆ ~ScopedProfiler()

template<typename Profiler>
slp::ScopedProfiler< Profiler >::~ScopedProfiler ( )
inline

Stops a profiler.

◆ ScopedProfiler() [2/3]

template<typename Profiler>
slp::ScopedProfiler< Profiler >::ScopedProfiler ( ScopedProfiler< Profiler > && rhs)
inlinenoexcept

Move constructor.

Parameters
rhsThe other ScopedProfiler.

◆ ScopedProfiler() [3/3]

template<typename Profiler>
slp::ScopedProfiler< Profiler >::ScopedProfiler ( const ScopedProfiler< Profiler > & )
delete

Member Function Documentation

◆ current_duration()

template<typename Profiler>
const std::chrono::duration< double > & slp::ScopedProfiler< Profiler >::current_duration ( ) const
inline

Returns the most recent solve duration in milliseconds as a double.

Returns
The most recent solve duration in milliseconds as a double.

◆ operator=()

template<typename Profiler>
ScopedProfiler & slp::ScopedProfiler< Profiler >::operator= ( const ScopedProfiler< Profiler > & )
delete

◆ stop()

template<typename Profiler>
void slp::ScopedProfiler< Profiler >::stop ( )
inline

Stops the profiler.

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


The documentation for this class was generated from the following file:
  • /home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/util/scoped_profiler.hpp