small changes

This commit is contained in:
2022-01-14 00:04:06 +03:00
parent 54d9a43e75
commit 97269fd160
11 changed files with 55 additions and 69 deletions

View File

@@ -1,18 +1,16 @@
using System;
using System.Diagnostics;
using System.Diagnostics;
namespace DTLib.Experimental
namespace DTLib.Experimental;
public static class Tester
{
public static class Tester
public static void LogOperationTime(string op_name, int repeats, Action operation)
{
public static void LogOperationTime(string op_name, int repeats, Action operation)
{
Stopwatch clock = new();
clock.Start();
for (int i = 0; i < repeats; i++)
operation();
clock.Stop();
PublicLog.LogNoTime("c",$"operation {op_name} took {clock.ElapsedTicks / repeats} ticks\n");
}
Stopwatch clock = new();
clock.Start();
for (int i = 0; i < repeats; i++)
operation();
clock.Stop();
LogNoTime("c",$"operation {op_name} took {clock.ElapsedTicks / repeats} ticks");
}
}
}