Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
util::ScopedTimer Class Reference

A utility class that helps with timing. More...

#include <ScopedTimer.h>

Public Member Functions

 ScopedTimer (std::string name)
 Create a scoped timer with the specified name.
 
 ScopedTimer ()
 Create an unnamed scoped timer.
 
std::chrono::microseconds elapsedTime () const
 Gets the elapsed time measured by this timer.
 

Detailed Description

A utility class that helps with timing.

Measures the elapsed time from the moment this class is instantiated to the moment that it's destructed.

Constructor & Destructor Documentation

◆ ScopedTimer() [1/2]

util::ScopedTimer::ScopedTimer ( std::string name)

Create a scoped timer with the specified name.

The elapsed time will be printed to stdout when destructed.

Parameters
nameThe name of this timer.

◆ ScopedTimer() [2/2]

util::ScopedTimer::ScopedTimer ( )

Create an unnamed scoped timer.

Nothing will be printed by this timer.

Member Function Documentation

◆ elapsedTime()

std::chrono::microseconds util::ScopedTimer::elapsedTime ( ) const

Gets the elapsed time measured by this timer.

Returns
The elapsed time, in microseconds.

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