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

@@ -8,6 +8,8 @@ using System.Collections;
using mbts;
using mbts.config;
using mbts.spark;
using System.Diagnostics;
using bts;
namespace BCG
{
@@ -167,18 +169,17 @@ namespace BCG
internal class ChangeDelegateWrapper
{
private HighPerformanceTimer myTimer = new HighPerformanceTimer ();
readonly Stopwatch timer = new();
private DataStream.ChangeDelegate myDel;
internal ChangeDelegateWrapper (DataStream.ChangeDelegate del) {myDel = del;}
internal void wrapperFunction (object o)
{
myTimer.start ();
timer.Restart();
myDel (o);
myTimer.stop ();
string minfo = "Type = " + myDel.Method.DeclaringType.FullName + " , method = " + myDel.Method.Name;
// BlueEventLog.logEvent (minfo + " , time = " + myTimer.lastIntervalTime.ToString (), BlueEventLevel.Performance);
timer.Stop();
Log.Gen.diag($"Type: {myDel.Method.DeclaringType.FullName}, Method = {myDel.Method.Name}");
}
}
}