Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
tesseract_common::Timer Class Reference

A simple timer class leveraging chrono high resolution clock. More...

#include <timer.h>

Public Member Functions

void start ()
 Start the timer. More...
 
void stop ()
 Stop the timer. More...
 
double elapsedMilliseconds () const
 Get the elapsed time in milliseconds. More...
 
double elapsedSeconds () const
 Get the elapsed time in seconds. More...
 

Private Types

using Clock = std::chrono::high_resolution_clock
 

Private Attributes

std::chrono::time_point< Clockstart_time_
 
std::chrono::time_point< Clockend_time_
 
bool running_ { false }
 

Detailed Description

A simple timer class leveraging chrono high resolution clock.

Member Typedef Documentation

◆ Clock

using tesseract_common::Timer::Clock = std::chrono::high_resolution_clock
private

Member Function Documentation

◆ elapsedMilliseconds()

double tesseract_common::Timer::elapsedMilliseconds ( ) const
inline

Get the elapsed time in milliseconds.

If timer is actively running it will use Clock::now() as the end time

Returns
The elapsed time in milliseconds

◆ elapsedSeconds()

double tesseract_common::Timer::elapsedSeconds ( ) const
inline

Get the elapsed time in seconds.

If timer is actively running it will use Clock::now() as the end time

Returns
The elapsed time in seconds

◆ start()

void tesseract_common::Timer::start ( )
inline

Start the timer.

◆ stop()

void tesseract_common::Timer::stop ( )
inline

Stop the timer.

Member Data Documentation

◆ end_time_

std::chrono::time_point<Clock> tesseract_common::Timer::end_time_
private

◆ running_

bool tesseract_common::Timer::running_ { false }
private

◆ start_time_

std::chrono::time_point<Clock> tesseract_common::Timer::start_time_
private

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