Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::PerformanceTimer Class Reference

High resolution timer for testing performance. More...

#include <PerformanceTimer.h>

Collaboration diagram for sf::PerformanceTimer:

Public Member Functions

 PerformanceTimer ()
 Default constructor. Initializes the timer and resets it.
 
 PerformanceTimer (const PerformanceTimer &pt)=default
 Copy constructor.
 
PerformanceTimeroperator= (const PerformanceTimer &pt)
 Assignment operator.
 
void reset ()
 Resets the time to start measuring.
 
TimeSpec elapse ()
 Returns the current elapsed time in seconds since the last reset.
 
TimeSpec elapse (const TimeSpec &ts)
 Returns the current elapsed time in seconds since the last reset.
 
unsigned long elapseUSec ()
 Returns the current elapsed time in micro seconds since the last reset.
 
unsigned long elapseMSec ()
 Returns the current elapsed time in milli seconds since the last reset.
 

Protected Attributes

TimeSpec _start
 Holds the start time.
 

Detailed Description

High resolution timer for testing performance.

Constructor & Destructor Documentation

◆ PerformanceTimer() [1/2]

sf::PerformanceTimer::PerformanceTimer ( )

Default constructor. Initializes the timer and resets it.

◆ PerformanceTimer() [2/2]

sf::PerformanceTimer::PerformanceTimer ( const PerformanceTimer pt)
default

Copy constructor.

Member Function Documentation

◆ elapse() [1/2]

TimeSpec sf::PerformanceTimer::elapse ( )

Returns the current elapsed time in seconds since the last reset.

◆ elapse() [2/2]

TimeSpec sf::PerformanceTimer::elapse ( const TimeSpec ts)

Returns the current elapsed time in seconds since the last reset.

◆ elapseMSec()

unsigned long sf::PerformanceTimer::elapseMSec ( )

Returns the current elapsed time in milli seconds since the last reset.

◆ elapseUSec()

unsigned long sf::PerformanceTimer::elapseUSec ( )

Returns the current elapsed time in micro seconds since the last reset.

◆ operator=()

PerformanceTimer & sf::PerformanceTimer::operator= ( const PerformanceTimer pt)
inline

Assignment operator.

◆ reset()

void sf::PerformanceTimer::reset ( )

Resets the time to start measuring.

Member Data Documentation

◆ _start

TimeSpec sf::PerformanceTimer::_start
protected

Holds the start time.


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