RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.system.Tracer Class Reference

Public Member Functions

 Tracer ()
void clearEpochs ()
final void resetTimer ()
void addEpoch (String epochName)
void printEpochs ()
void printEpochs (Consumer< String > output)

Detailed Description

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.

Definition at line 20 of file Tracer.java.

Constructor & Destructor Documentation

◆ Tracer()

org.wpilib.system.Tracer.Tracer ( )

Tracer constructor.

Definition at line 29 of file Tracer.java.

Member Function Documentation

◆ addEpoch()

void org.wpilib.system.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.

Parameters
epochNameThe name to associate with the epoch.

Definition at line 55 of file Tracer.java.

◆ clearEpochs()

void org.wpilib.system.Tracer.clearEpochs ( )

Clears all epochs.

Definition at line 34 of file Tracer.java.

◆ printEpochs() [1/2]

void org.wpilib.system.Tracer.printEpochs ( )

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

Definition at line 62 of file Tracer.java.

◆ printEpochs() [2/2]

void org.wpilib.system.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.

Parameters
outputthe stream that the output is sent to

Definition at line 73 of file Tracer.java.

◆ resetTimer()

final void org.wpilib.system.Tracer.resetTimer ( )

Restarts the epoch timer.

Definition at line 40 of file Tracer.java.


The documentation for this class was generated from the following file: