WPILibC++ 2024.3.2
|
A class for keeping track of how much time it takes for different parts of code to execute. More...
#include <frc/Tracer.h>
Public Member Functions | |
Tracer () | |
Constructs a Tracer instance. More... | |
void | ResetTimer () |
Restarts the epoch timer. More... | |
void | ClearEpochs () |
Clears all epochs. More... | |
void | AddEpoch (std::string_view epochName) |
Adds time since last epoch to the list printed by PrintEpochs(). More... | |
void | PrintEpochs () |
Prints list of epochs added so far and their times to the DriverStation. More... | |
void | PrintEpochs (wpi::raw_ostream &os) |
Prints list of epochs added so far and their times to a stream. More... | |
A class for keeping track of how much time it takes for different parts of code to execute.
This is done with epochs, that are added to calls to AddEpoch() and can be printed with a call to PrintEpochs().
Epochs are a way to partition the time elapsed so that when overruns occur, one can determine which parts of an operation consumed the most time.
frc::Tracer::Tracer | ( | ) |
Constructs a Tracer instance.
void frc::Tracer::AddEpoch | ( | std::string_view | epochName | ) |
Adds time since last epoch to the list printed by PrintEpochs().
Epochs are a way to partition the time elapsed so that when overruns occur, one can determine which parts of an operation consumed the most time.
epochName | The name to associate with the epoch. |
void frc::Tracer::ClearEpochs | ( | ) |
Clears all epochs.
void frc::Tracer::PrintEpochs | ( | ) |
Prints list of epochs added so far and their times to the DriverStation.
void frc::Tracer::PrintEpochs | ( | wpi::raw_ostream & | os | ) |
Prints list of epochs added so far and their times to a stream.
os | output stream |
void frc::Tracer::ResetTimer | ( | ) |
Restarts the epoch timer.