Tracer

class wpilib.Tracer(self: wpilib.Tracer) → None

Bases: pybind11_builtins.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(self: wpilib.Tracer, 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(self: wpilib.Tracer) → None

Clears all epochs.

getEpochs(self: wpilib.Tracer) → 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(self: wpilib.Tracer) → None

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

resetTimer(self: wpilib.Tracer) → None

Restarts the epoch timer.