protected void RunCycles() { int millesecondsPerCycle = 1000 / ClockSpeed; Stopwatch s = new Stopwatch(); s.Start(); while (true) { CheckInput(); if (_threadStopped) { break; } _chip8.EmulateCycle(); Draw(); while (s.ElapsedMilliseconds < millesecondsPerCycle) { Thread.Sleep(1); } s.Restart(); } }
protected void RunCycles() { int millesecondsPerCycle = 1000 / ClockSpeed; Stopwatch s = new Stopwatch(); s.Start(); while (true) { chip8.EmulateCycle(); while (s.ElapsedMilliseconds < millesecondsPerCycle) { Thread.Sleep(1); } s.Restart(); } }