_adaptive sleep

This commit is contained in:
2023-05-21 20:22:56 +03:00
parent 07c34fa70b
commit d3f14efbbd
2 changed files with 45 additions and 5 deletions

View File

@@ -370,6 +370,15 @@ void Win32Platform::SetThreadAffinityMask(uint64 affinityMask)
void Win32Platform::Sleep(int32 milliseconds)
{
if (milliseconds < 0)
{
::SwitchToThread();
return;
}
//::Sleep(milliseconds);
//return;
static thread_local HANDLE timer = NULL;
if (timer == NULL)
{