mCRL2
Loading...
Searching...
No Matches
stopwatch Class Reference

Implements a simple stopwatch that starts on construction. More...

#include <stopwatch.h>

Public Member Functions

 stopwatch ()
 
void reset ()
 Reset the stopwatch to count from this moment onwards.
 
long long time ()
 
double seconds ()
 

Private Attributes

std::chrono::time_point< std::chrono::steady_clock > m_timestamp
 

Detailed Description

Implements a simple stopwatch that starts on construction.

Definition at line 16 of file stopwatch.h.

Constructor & Destructor Documentation

◆ stopwatch()

stopwatch::stopwatch ( )
inline

Definition at line 19 of file stopwatch.h.

Member Function Documentation

◆ reset()

void stopwatch::reset ( )
inline

Reset the stopwatch to count from this moment onwards.

Definition at line 25 of file stopwatch.h.

◆ seconds()

double stopwatch::seconds ( )
inline
Returns
The time in seconds since the last reset.

Definition at line 37 of file stopwatch.h.

◆ time()

long long stopwatch::time ( )
inline
Returns
The time in milliseconds since the last reset.

Definition at line 31 of file stopwatch.h.

Member Data Documentation

◆ m_timestamp

std::chrono::time_point<std::chrono::steady_clock> stopwatch::m_timestamp
private

Definition at line 43 of file stopwatch.h.


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