diff --git a/src/Lynx/UCIHandler.cs b/src/Lynx/UCIHandler.cs index 6688abf60..7bb21aee1 100644 --- a/src/Lynx/UCIHandler.cs +++ b/src/Lynx/UCIHandler.cs @@ -560,6 +560,7 @@ private async ValueTask HandleStaticEval(string rawCommand, CancellationToken ca return; } + int lineCounter = 0; foreach (var line in await File.ReadAllLinesAsync(fullPath, cancellationToken)) { var fen = line[..line.IndexOfAny([';', '[', '"'])]; @@ -584,6 +585,13 @@ private async ValueTask HandleStaticEval(string rawCommand, CancellationToken ca } await _engineToUci.Writer.WriteAsync($"{line}: {eval}", cancellationToken); + +#pragma warning disable S2583 // Conditionally executed code should be reachable + if (++lineCounter % 100 == 0) + { + Thread.Sleep(50); + } +#pragma warning restore S2583 // Conditionally executed code should be reachable } } catch (Exception e)