2021-08-23 16:50:18 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Flowframes.MiscUtils
|
|
|
|
|
|
{
|
|
|
|
|
|
class NmkdStopwatch
|
|
|
|
|
|
{
|
2021-12-06 22:46:39 +01:00
|
|
|
|
public Stopwatch sw = new Stopwatch();
|
|
|
|
|
|
public long ElapsedMs { get { return sw.ElapsedMilliseconds; } }
|
2021-08-23 16:50:18 +02:00
|
|
|
|
|
2021-12-06 22:46:39 +01:00
|
|
|
|
public NmkdStopwatch(bool startOnCreation = true)
|
2021-08-23 16:50:18 +02:00
|
|
|
|
{
|
|
|
|
|
|
if (startOnCreation)
|
|
|
|
|
|
sw.Restart();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-06 22:46:39 +01:00
|
|
|
|
public override string ToString()
|
2021-08-23 16:50:18 +02:00
|
|
|
|
{
|
|
|
|
|
|
return FormatUtils.TimeSw(sw);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|