WPILibC++  2020.3.2-60-g3011ebe
frc::Tracer Class Reference

A class for keeping track of how much time it takes for different parts of code to execute. More...

#include <Tracer.h>

Public Member Functions

 Tracer ()
 Constructs a Tracer instance.
 
void ResetTimer ()
 Restarts the epoch timer.
 
void ClearEpochs ()
 Clears all epochs.
 
void AddEpoch (wpi::StringRef 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.
 
void PrintEpochs (wpi::raw_ostream &os)
 Prints list of epochs added so far and their times to a stream. More...
 

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 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.

Member Function Documentation

◆ AddEpoch()

void frc::Tracer::AddEpoch ( wpi::StringRef  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.

Parameters
epochNameThe name to associate with the epoch.

◆ PrintEpochs()

void frc::Tracer::PrintEpochs ( wpi::raw_ostream os)

Prints list of epochs added so far and their times to a stream.

Parameters
osoutput stream

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