mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
love.timer.sleep max precision is now in ns instead of ms.
resolves #1970.
This commit is contained in:
@@ -25,12 +25,11 @@
|
|||||||
namespace love
|
namespace love
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: use ns. https://github.com/libsdl-org/SDL/issues/11141
|
|
||||||
void sleep(double ms)
|
void sleep(double ms)
|
||||||
{
|
{
|
||||||
// We don't need to initialize the SDL timer subsystem for SDL_Delay to
|
// 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.
|
// function - and doing so causes SDL to create a worker thread.
|
||||||
SDL_Delay((Uint32)ms);
|
SDL_DelayNS(SDL_NS_PER_MS * ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // love
|
} // love
|
||||||
|
|||||||
Reference in New Issue
Block a user