WPILibC++ 2023.4.3-108-ge5452e3
frc::ScopedTracer Class Reference

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

#include <frc/ScopedTracer.h>

Public Member Functions

 ScopedTracer (std::string_view name, wpi::raw_ostream &os)
 Constructs a ScopedTracer instance. More...
 
 ~ScopedTracer ()
 
 ScopedTracer (const ScopedTracer &)=delete
 
ScopedTraceroperator= (const ScopedTracer &)=delete
 

Detailed Description

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

This class uses RAII, meaning you simply need to create an instance at the top of the block you are timing. After the block finishes execution (i.e. when the ScopedTracer instance gets destroyed), the epoch is printed to the provided raw_ostream.

Constructor & Destructor Documentation

◆ ScopedTracer() [1/2]

frc::ScopedTracer::ScopedTracer ( std::string_view  name,
wpi::raw_ostream os 
)

Constructs a ScopedTracer instance.

Parameters
nameThe name of the epoch.
osA reference to the raw_ostream to print data to.

◆ ~ScopedTracer()

frc::ScopedTracer::~ScopedTracer ( )

◆ ScopedTracer() [2/2]

frc::ScopedTracer::ScopedTracer ( const ScopedTracer )
delete

Member Function Documentation

◆ operator=()

ScopedTracer & frc::ScopedTracer::operator= ( const ScopedTracer )
delete

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