PowerToys/Wox.Infrastructure/Timeit.cs
2015-10-30 23:23:01 +00:00

24 lines
495 B
C#

using System;
using System.Diagnostics;
namespace Wox.Infrastructure
{
public class Timeit : IDisposable
{
private Stopwatch stopwatch = new Stopwatch();
private string name;
public Timeit(string name)
{
this.name = name;
stopwatch.Start();
}
public void Dispose()
{
stopwatch.Stop();
DebugHelper.WriteLine(name + ":" + stopwatch.ElapsedMilliseconds + "ms");
}
}
}