From c4ce22ef249ef710ec0ff624b44aa948efe9327a Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sat, 29 Apr 2023 00:06:33 +0300 Subject: QEventDispatcher/WASM: fix a lambda name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's returning milliseconds not nanoseconds. Change-Id: I7dbc3f4043694b6ddf87c6ad9e4d20d3a9af0fd1 Reviewed-by: Morten Johan Sørvig Reviewed-by: Marc Mutz Reviewed-by: Mikołaj Boc --- src/corelib/kernel/qeventdispatcher_wasm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_wasm.cpp b/src/corelib/kernel/qeventdispatcher_wasm.cpp index 8b64856621..6818a5eab8 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm.cpp +++ b/src/corelib/kernel/qeventdispatcher_wasm.cpp @@ -507,13 +507,13 @@ void QEventDispatcherWasm::updateNativeTimer() // access to m_timerInfo), and then call native API to set the new // wakeup time on the main thread. - auto timespecToNanosec = [](timespec ts) -> uint64_t { + auto timespecToMsec = [](timespec ts) -> uint64_t { return ts.tv_sec * 1000 + ts.tv_nsec / (1000 * 1000); }; timespec toWait; bool hasTimer = m_timerInfo->timerWait(toWait); - uint64_t currentTime = timespecToNanosec(m_timerInfo->currentTime); - uint64_t toWaitDuration = timespecToNanosec(toWait); + uint64_t currentTime = timespecToMsec(m_timerInfo->currentTime); + uint64_t toWaitDuration = timespecToMsec(toWait); uint64_t newTargetTime = currentTime + toWaitDuration; auto maintainNativeTimer = [this, hasTimer, toWaitDuration, newTargetTime]() { -- cgit v1.2.1