diff --git a/src/common/timer.cpp b/src/common/timer.cpp index bdcb20cde..6b74097d8 100644 --- a/src/common/timer.cpp +++ b/src/common/timer.cpp @@ -395,7 +395,7 @@ void Timer::NanoSleep(std::uint64_t ns) // Round down to the next millisecond. usleep(static_cast((ns / 1000000) * 1000)); #else - const struct timespec ts = {0, static_cast(ns)}; + const struct timespec ts = {static_cast(ns / 1000000000ULL), static_cast(ns % 1000000000ULL)}; nanosleep(&ts, nullptr); #endif }