Files
flowframes/Code5/MiscUtils/Benchmarker.cs
2021-01-26 02:37:16 -05:00

44 lines
825 B
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Flowframes.MiscUtils
{
class Benchmarker
{
static Stopwatch sw = new Stopwatch();
public static void Start ()
{
sw.Restart();
}
public static string GetTimeStr (bool stop)
{
if (stop)
sw.Stop();
return FormatUtils.TimeSw(sw);
}
public static TimeSpan GetTime(bool stop)
{
if (stop)
sw.Stop();
return sw.Elapsed;
}
public static long GetTimeMs(bool stop)
{
if (stop)
sw.Stop();
return sw.ElapsedMilliseconds;
}
}
}