added frame drop logging

This commit is contained in:
Thomas Jentzsch 2021-10-04 10:11:24 +02:00
parent 16b9ebe0f8
commit a2eb62402f
1 changed files with 5 additions and 1 deletions

View File

@ -20,6 +20,7 @@
#include "EmulationWorker.hxx" #include "EmulationWorker.hxx"
#include "DispatchResult.hxx" #include "DispatchResult.hxx"
#include "TIA.hxx" #include "TIA.hxx"
#include "Logger.hxx"
using namespace std::chrono; using namespace std::chrono;
@ -238,10 +239,13 @@ void EmulationWorker::handleWakeupFromWaitingForStop(std::unique_lock<std::mutex
break; break;
case Signal::none: case Signal::none:
if (myVirtualTime <= high_resolution_clock::now()) if(myVirtualTime <= high_resolution_clock::now())
// The time allotted to the emulation timeslice has passed and we haven't been stopped? // The time allotted to the emulation timeslice has passed and we haven't been stopped?
// -> go for another emulation timeslice // -> go for another emulation timeslice
{
Logger::debug("Frame dropped!");
dispatchEmulation(lock); dispatchEmulation(lock);
}
else else
// Wakeup was spurious, reenter sleep // Wakeup was spurious, reenter sleep
myWakeupCondition.wait_until(lock, myVirtualTime); myWakeupCondition.wait_until(lock, myVirtualTime);