Robot Core Documentation
|
Public Member Functions | |
Tracer () | |
void | clearEpochs () |
final void | resetTimer () |
void | addEpoch (String epochName) |
void | printEpochs () |
void | printEpochs (Consumer< String > output) |
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 by calls to addEpoch(String)
, 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.
edu.wpi.first.wpilibj.Tracer.Tracer | ( | ) |
Tracer constructor.
void edu.wpi.first.wpilibj.Tracer.addEpoch | ( | String | 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.
This should be called immediately after execution has finished, with a call to this method or resetTimer()
before execution.
epochName | The name to associate with the epoch. |
void edu.wpi.first.wpilibj.Tracer.clearEpochs | ( | ) |
Clears all epochs.
void edu.wpi.first.wpilibj.Tracer.printEpochs | ( | ) |
Prints list of epochs added so far and their times to the DriverStation.
void edu.wpi.first.wpilibj.Tracer.printEpochs | ( | Consumer< String > | output | ) |
Prints list of epochs added so far and their times to the entered String consumer.
This overload can be useful for logging to a file, etc.
output | the stream that the output is sent to |
final void edu.wpi.first.wpilibj.Tracer.resetTimer | ( | ) |
Restarts the epoch timer.