1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-21 02:17:08 +00:00

Add capacity for enforcing a delay.

This commit is contained in:
Thomas Harte
2026-04-03 09:51:51 -04:00
parent 9f0e47a8dd
commit 21f0a2eacb
2 changed files with 10 additions and 1 deletions
+4
View File
@@ -17,6 +17,10 @@ using namespace Storage;
TimedEventLoop::TimedEventLoop(Cycles::IntType input_clock_rate) :
input_clock_rate_(input_clock_rate) {}
void TimedEventLoop::add_delay(const Cycles cycles) {
cycles_until_event_ += cycles.get();
}
void TimedEventLoop::run_for(const Cycles cycles) {
auto remaining_cycles = cycles.get();
#ifndef NDEBUG
+6 -1
View File
@@ -46,7 +46,12 @@ public:
/*!
Advances the event loop by @c number_of_cycles cycles.
*/
void run_for(const Cycles);
void run_for(Cycles);
/*!
Extends the amount of time until the next event fires.
*/
void add_delay(Cycles);
/*!
@returns the number of whole cycles remaining until the next event is triggered.