AppleWin/source/frontends/common2/speed.h
Andrea Odetti 1d07215f78 Add ability to Save/Load Snapshot F11/F12.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2020-12-06 18:03:41 +00:00

21 lines
426 B
C++

#pragma once
#include <chrono>
class Speed
{
public:
Speed(const bool fixedSpeed);
void reset();
// calculate the number of cycles to execute in the current period
// assuming the next call will happen in x milliseconds
size_t getCyclesTillNext(const size_t milliseconds) const;
private:
const bool myFixedSpeed;
std::chrono::time_point<std::chrono::steady_clock> myStartTime;
uint64_t myStartCycles;
};