From d9f03fdddf5cdf426f6d1ca80177177313462b9e Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Wed, 25 Mar 2026 19:13:12 -0500 Subject: [PATCH] refactor: replace 0ms sleep with a proper yield --- Minecraft.Client/Minecraft.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 76aab6c96..dfd39cd8e 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -2144,8 +2144,10 @@ void Minecraft::run_middle() { achievementPopup->render(); PIXBeginNamedEvent(0, "Sleeping"); - std::this_thread::sleep_for( - std::chrono::milliseconds(0)); // 4J - was Thread.yield()) + std::this_thread::yield_now(); // 4jcraft added now that we have + // portable thread yield. + // std::this_thread::sleep_for( + // std::chrono::milliseconds(0)); // 4J - was Thread.yield()) PIXEndNamedEvent(); // if (Keyboard::isKeyDown(Keyboard::KEY_F7))