Records the number of profiler measurements (start/stop pairs) and the average duration between each start and stop call.
More...
#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/util/solve_profiler.hpp>
|
| | SolveProfiler (std::string_view name) |
| | Constructs a SolveProfiler.
|
| void | start () |
| | Tell the profiler to start measuring solve time.
|
| void | stop () |
| | Tell the profiler to stop measuring solve time, increment the number of averages, and incorporate the latest measurement into the average.
|
| std::string_view | name () const |
| | Returns name of measurement to show in diagnostics.
|
| int | num_solves () const |
| | Returns the number of solves.
|
| const std::chrono::duration< double > & | current_duration () const |
| | Returns the most recent solve duration in seconds.
|
| const std::chrono::duration< double > & | average_duration () const |
| | Returns the average solve duration in seconds.
|
| const std::chrono::duration< double > & | total_duration () const |
| | Returns the sum of all solve durations in seconds.
|
Records the number of profiler measurements (start/stop pairs) and the average duration between each start and stop call.
◆ SolveProfiler()
| slp::SolveProfiler::SolveProfiler |
( |
std::string_view | name | ) |
|
|
inlineexplicit |
Constructs a SolveProfiler.
- Parameters
-
| name | Name of measurement to show in diagnostics. |
◆ average_duration()
| const std::chrono::duration< double > & slp::SolveProfiler::average_duration |
( |
| ) |
const |
|
inline |
Returns the average solve duration in seconds.
- Returns
- The average solve duration in seconds.
◆ current_duration()
| const std::chrono::duration< double > & slp::SolveProfiler::current_duration |
( |
| ) |
const |
|
inline |
Returns the most recent solve duration in seconds.
- Returns
- The most recent solve duration in seconds.
◆ name()
| std::string_view slp::SolveProfiler::name |
( |
| ) |
const |
|
inline |
Returns name of measurement to show in diagnostics.
- Returns
- Name of measurement to show in diagnostics.
◆ num_solves()
| int slp::SolveProfiler::num_solves |
( |
| ) |
const |
|
inline |
Returns the number of solves.
- Returns
- The number of solves.
◆ start()
| void slp::SolveProfiler::start |
( |
| ) |
|
|
inline |
Tell the profiler to start measuring solve time.
◆ stop()
| void slp::SolveProfiler::stop |
( |
| ) |
|
|
inline |
Tell the profiler to stop measuring solve time, increment the number of averages, and incorporate the latest measurement into the average.
◆ total_duration()
| const std::chrono::duration< double > & slp::SolveProfiler::total_duration |
( |
| ) |
const |
|
inline |
Returns the sum of all solve durations in seconds.
- Returns
- The sum of all solve durations in seconds.
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/solve_profiler.hpp