Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
PerformanceTimer.h
Go to the documentation of this file.
1#pragma once
2#include <misc/gen/TimeSpec.h>
3
4namespace sf
5{
6
11{
12 public:
17
21 PerformanceTimer(const PerformanceTimer& pt) = default;
22
27 {
28 if (this != &pt)
29 {
30 _start = pt._start;
31 }
32 return *this;
33 }
34
38 void reset();
39
44
49
53 unsigned long elapseUSec();
54
58 unsigned long elapseMSec();
59
60 protected:
65};
66
67}// namespace sf
High resolution timer for testing performance.
Definition PerformanceTimer.h:11
PerformanceTimer(const PerformanceTimer &pt)=default
Copy constructor.
unsigned long elapseUSec()
Returns the current elapsed time in micro seconds since the last reset.
void reset()
Resets the time to start measuring.
PerformanceTimer & operator=(const PerformanceTimer &pt)
Assignment operator.
Definition PerformanceTimer.h:26
TimeSpec elapse(const TimeSpec &ts)
Returns the current elapsed time in seconds since the last reset.
TimeSpec elapse()
Returns the current elapsed time in seconds since the last reset.
PerformanceTimer()
Default constructor. Initializes the timer and resets it.
unsigned long elapseMSec()
Returns the current elapsed time in milli seconds since the last reset.
TimeSpec _start
Holds the start time.
Definition PerformanceTimer.h:64
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
Class wrapper for timespec structure to modify.
Definition TimeSpec.h:12