PowerToys/Wox.Infrastructure/Timeit.cs
bao-qian 9d9400f4d9 Fix Debug output
DebugHelper is useless, bacuase the return statement is always executed before the actual code.
2015-10-31 18:06:57 +00:00

24 lines
489 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();
Debug.WriteLine(name + ":" + stopwatch.ElapsedMilliseconds + "ms");
}
}
}