wavelength 1.0.0
Loading...
Searching...
No Matches
schedulerclock.h
Go to the documentation of this file.
1#pragma once
2
10public:
18 explicit SchedulerClock(float fMs);
19
26 void Start();
27
34 void Stop();
35
43 int IsRunning() const;
44
52 void SetTime(float fMs);
53
61 void SetRate(float fRate);
62
70 float GetRate() const;
71
79 float GetTime();
80
81private:
82 unsigned long long mStart; // The system cycles at the last start.
83 long long mElapsed; // The scaled cycles measured before the last start.
84 int mRunning; // Non-zero while the clock runs.
85 float mRate; // The rate the cycles since the start are scaled by.
86};
void SetTime(float fMs)
Set the time, measuring from now.
int IsRunning() const
Report whether the clock runs.
float GetTime()
Report the time.
SchedulerClock(float fMs)
Construct a stopped clock at a time, at the normal rate.
float GetRate() const
Report the rate.
void Start()
Start a stopped clock.
void SetRate(float fRate)
Change the rate, keeping the time measured so far.
void Stop()
Stop a running clock, adding the scaled cycles since the start to the time.