1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Added AutoStopwatchPerf

This commit is contained in:
Brian Fiete 2022-04-30 07:33:23 -07:00
parent 23b777c6f8
commit 0918c702c6

View file

@ -139,4 +139,22 @@ namespace System.Diagnostics
}
}
class AutoStopwatchPerf
{
String mName ~ delete _;
Stopwatch mStopwatch = new .() ~ delete _;
public this(StringView name)
{
mName = new .(name);
mStopwatch.Start();
}
public ~this()
{
mStopwatch.Stop();
Debug.WriteLine($"{mName} {mStopwatch.Elapsed}");
}
}
}