From eab70546c8cbb57e9744515230952b3724e406d8 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 11 Jul 2020 03:21:05 +1000 Subject: [PATCH] CDROMAsyncReader: Only log warning when waiting time exceeds 1ms --- src/core/cdrom_async_reader.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/cdrom_async_reader.cpp b/src/core/cdrom_async_reader.cpp index 966b4d6a0..9da39d6fc 100644 --- a/src/core/cdrom_async_reader.cpp +++ b/src/core/cdrom_async_reader.cpp @@ -123,7 +123,13 @@ bool CDROMAsyncReader::WaitForReadToComplete() if (m_sector_read_pending.load()) { Log_DebugPrintf("Sector read pending, waiting"); + + Common::Timer wait_timer; m_notify_read_complete_cv.wait(lock, [this]() { return !m_sector_read_pending.load(); }); + + const double wait_time = wait_timer.GetTimeMilliseconds(); + if (wait_time > 1.0f) + Log_WarningPrintf("Had to wait %.2f msec for LBA %u", wait_time, m_last_read_sector); } return m_sector_read_result.load(); @@ -156,7 +162,7 @@ void CDROMAsyncReader::DoSectorRead() const double read_time = timer.GetTimeMilliseconds(); if (read_time > 1.0f) - Log_WarningPrintf("Read LBA %u took %.2f msec", pos, read_time); + Log_DevPrintf("Read LBA %u took %.2f msec", pos, read_time); } void CDROMAsyncReader::WorkerThreadEntryPoint()