From 0c7fc9c04a743ab0ee1a82961ca688e6604d8f90 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Sat, 19 Oct 2024 15:36:34 -0300 Subject: [PATCH] love.timer.sleep max precision is now in ns instead of ms. resolves #1970. --- src/common/delay.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/delay.cpp b/src/common/delay.cpp index 8d1b0abb4..381ef5f2e 100644 --- a/src/common/delay.cpp +++ b/src/common/delay.cpp @@ -25,12 +25,11 @@ namespace love { -// TODO: use ns. https://github.com/libsdl-org/SDL/issues/11141 void sleep(double ms) { // We don't need to initialize the SDL timer subsystem for SDL_Delay to // function - and doing so causes SDL to create a worker thread. - SDL_Delay((Uint32)ms); + SDL_DelayNS(SDL_NS_PER_MS * ms); } } // love