1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| public class HHTimeRecorder { private DateTime beginTime; public void Begin() { beginTime = DateTime.Now; }
public long End() { var ret = DateTime.Now - beginTime; return ret.Ticks / 10000; }
public void End(string prefix) { var costTime = End(); HHLogger.DEBUG(prefix, "cost time", costTime, "ms"); } }
|