示例#1
0
        public Profiler(IDebugContext debugContext, LogLevel logLevel, string name = null)
        {
            _debugContext = debugContext;
            _logLevel     = logLevel;
            _name         = name;

            _watch = Stopwatch.StartNew();
            _debugContext.Log(logLevel, "Start: {0}", _name ?? String.Empty);
        }
示例#2
0
        public Profiler(IDebugContext debugContext, LogLevel logLevel, string name = null)
        {
            _debugContext = debugContext;
            _logLevel = logLevel;
            _name = name;

            _watch = Stopwatch.StartNew();
            _debugContext.Log(logLevel, "Start: {0}", _name ?? String.Empty);
        }
示例#3
0
 public void Dispose()
 {
     _watch.Stop();
     _debugContext.Log(_logLevel, "End: {0} - Execution time: {1} ms", _name ?? String.Empty, _watch.ElapsedMilliseconds);
 }