From f3cdce0f6ebc39293fa002a83b596751a6d6a65c Mon Sep 17 00:00:00 2001 From: bung87 Date: Sat, 6 Jan 2024 12:22:51 +0800 Subject: [PATCH] sleep 16ms when using synchronous io on windows for reducing cpu usage --- src/nimlsp.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nimlsp.nim b/src/nimlsp.nim index 0442cd4..5da89a5 100644 --- a/src/nimlsp.nim +++ b/src/nimlsp.nim @@ -666,6 +666,8 @@ proc main(ins: Stream | AsyncFile, outs: Stream | AsyncFile) {.multisync.} = except CatchableError as e: warnLog "Got exception: ", e.msg continue + when defined(windows): + sleep(16) when defined(windows): var