Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Timing::Timer Struct Reference

#include <Timing.h>

Public Member Functions

 Timer ()
 
void stop ()
 
U64 getMicroseconds ()
 
F64 getMilliseconds ()
 
F64 getSeconds ()
 

Detailed Description

Definition at line 10 of file Timing.h.

Constructor & Destructor Documentation

◆ Timer()

Timing::Timer::Timer ( )
inline

Definition at line 12 of file Timing.h.

12: startTime(std::chrono::high_resolution_clock::now()), isStopped(false) {}

Member Function Documentation

◆ getMicroseconds()

U64 Timing::Timer::getMicroseconds ( )
inline

Definition at line 14 of file Timing.h.

15 {
16 if(!isStopped) { stop(); }
17 return std::chrono::duration_cast<std::chrono::microseconds>(endTime - startTime).count();
18 }
void stop()
Definition Timing.h:13
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMilliseconds()

F64 Timing::Timer::getMilliseconds ( )
inline

Definition at line 19 of file Timing.h.

19{ return getMicroseconds() / 1000.0; }
U64 getMicroseconds()
Definition Timing.h:14
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSeconds()

F64 Timing::Timer::getSeconds ( )
inline

Definition at line 20 of file Timing.h.

20{ return getMicroseconds() / 1000000.0; }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop()

void Timing::Timer::stop ( )
inline

Definition at line 13 of file Timing.h.

13{ endTime = std::chrono::high_resolution_clock::now(); }
Here is the caller graph for this function:

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