Tracer

class wpilib.Tracer

Bases: pybind11_object

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.

Constructs a Tracer instance.

addEpoch(epochName: str) None

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.

Parameters:

epochName – The name to associate with the epoch.

clearEpochs() None

Clears all epochs.

getEpochs() str

Retreives list of epochs added so far as a string

New in version 2021.1.2.

Note

This function only exists in RobotPy

printEpochs() None

Prints list of epochs added so far and their times to the DriverStation.

resetTimer() None

Restarts the epoch timer.