Skip to content

Commit

Permalink
love.timer.sleep max precision is now in ns instead of ms.
Browse files Browse the repository at this point in the history
resolves #1970.
  • Loading branch information
slime73 committed Oct 19, 2024
1 parent b116857 commit 0c7fc9c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/common/delay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0c7fc9c

Please sign in to comment.