Skip to content

Commit

Permalink
[#93] comment
Browse files Browse the repository at this point in the history
  • Loading branch information
vbmacher committed Jan 2, 2024
1 parent 6fc7532 commit 05a2e1d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ public CPU.RunState run(Supplier<Double> getTargetFrequencyKHz, Supplier<CPU.Run
return currentRunState;
}

/**
* Runs the CPU without "sleeping".
* <p>
* The "runInstruction" function must call {@link #addExecutedCycles(long)} to update executed cycles.
*
* @param getTargetFrequencyKHz get target frequency in kHz
* @param runInstruction runs one instruction
* @return new run state
*/
public CPU.RunState runNoSleep(Supplier<Double> getTargetFrequencyKHz, Supplier<CPU.RunState> runInstruction) {
double oneCycleTimeNanos = 1000000.0 / getTargetFrequencyKHz.get();

Expand Down

0 comments on commit 05a2e1d

Please sign in to comment.