AppleWin/source/frontends/common2/speed.h
Andrea Odetti a121981e5a sa2: Add support for --headless and --fixed-speed.
Headless will skip the video refresh (and the vsync).
Fixed-Speed will avoid adaptive speed.

Used together, the emulator will go at maximum speed skipping video refresh (useful for profiling).
2020-11-21 15:07:31 +00:00

19 lines
409 B
C++

#pragma once
#include <chrono>
class Speed
{
public:
Speed(const bool fixedSpeed);
// 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;
};