mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 12:09:18 +08:00
27 lines
567 B
C#
27 lines
567 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
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","Wox");
|
|
}
|
|
}
|
|
}
|