Skip to content

Commit

Permalink
Add Mnps to perft and divide outputs (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Aug 16, 2023
1 parent 9fd25f7 commit 08c280d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Lynx/Perft.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ public static void PrintPerftResult(int depth, (long Nodes, double ElapsedMillis
write(
$"Depth:\t{depth}" + Environment.NewLine +
$"Nodes:\t{peftResult.Nodes}" + Environment.NewLine +
$"Time:\t{timeStr}" + Environment.NewLine);
$"Time:\t{timeStr}" + Environment.NewLine +
$"nps:\t{(Math.Round(peftResult.Nodes / peftResult.ElapsedMilliseconds)) / 1000} Mnps" + Environment.NewLine);
}

public static async ValueTask PrintPerftResult(int depth, (long Nodes, double ElapsedMilliseconds) peftResult, Func<string, ValueTask> write)
Expand All @@ -192,7 +193,8 @@ public static async ValueTask PrintPerftResult(int depth, (long Nodes, double El
await write(
$"Depth:\t{depth}" + Environment.NewLine +
$"Nodes:\t{peftResult.Nodes}" + Environment.NewLine +
$"Time:\t{timeStr}" + Environment.NewLine);
$"Time:\t{timeStr}" + Environment.NewLine +
$"nps:\t{(Math.Round(peftResult.Nodes / peftResult.ElapsedMilliseconds)) / 1000} Mnps" + Environment.NewLine);
}

/// <summary>
Expand Down

0 comments on commit 08c280d

Please sign in to comment.