refactor: Replace HighPerformanceTimer w/ Stopwatch

This is needed to build DataStreamSuite on Linux.

'Stopwatch' is a platform independent timer class included with the
System.Runtime library in modern dotnet. 'HighPerformanceTimer' is a BTS
class that predates Stopwatch, and is NOT platform independent as it
relies on Windows kernel32.dll QueryPerformanceCounter/Frequency fns.
This commit is contained in:
John Colvin committed 2024-06-03 13:46:51 +00:00
1 parent 7ee6933789
commit 9050318ceb
18 files changed
+110 -184

No files matched your search

+9 -20
View File
@@ -1,7 +1,4 @@
using mbts.spark;
using System;
using System.Runtime;
using System.Diagnostics;
namespace BCG.Utilities.General
{
@@ -12,30 +9,22 @@ namespace BCG.Utilities.General
{
public Crono()
{
myTimer = new HighPerformanceTimer();
myTimer = new();
}
public void start()
{myTimer.start();}
{myTimer.Start();}
public void stop()
{myTimer.stop();}
{myTimer.Stop();}
public TimeSpan time
{
get
{
return new TimeSpan((long) (myTimer.totalMilliseconds * TimeSpan.TicksPerMillisecond));
}
}
public TimeSpan time =>
myTimer.Elapsed;
public double miliseconds
{
get
{return myTimer.totalMilliseconds;}
}
public double miliseconds =>
myTimer.Elapsed.TotalMilliseconds;
private HighPerformanceTimer myTimer;
private Stopwatch myTimer;
}
}