public void Trace(string message) { if (traceList != null) { TimerTrace t = new TimerTrace(); t.Timestamp = DateTime.Now; t.Message = message; if (lastTrace == null) { lastTrace = traceList.FirstTrace = t; } else { lastTrace.Next = t; lastTrace = t; } traceList.TotalTime = t.Timestamp - traceList.FirstTrace.Timestamp; } else { var time = stopWatch.ElapsedMilliseconds; InstrumentationService.LogMessage(string.Format("[{0} (+{1})] {2}", time, (time - lastTraceTime), message)); lastTraceTime = time; } }
public IEnumerable <TimerTrace> GetTimerTraces() { TimerTrace trace = traces?.FirstTrace; while (trace != null) { yield return(trace); trace = trace.Next; } }
public void Trace (string message) { TimerTrace t = new TimerTrace (); t.Timestamp = DateTime.Now; t.Message = message; if (lastTrace == null) lastTrace = traceList.FirstTrace = t; else { lastTrace.Next = t; lastTrace = t; } traceList.TotalTime = t.Timestamp - traceList.FirstTrace.Timestamp; }
public IEnumerable <TimerTrace> GetTimerTraces() { if (traces == null) { yield break; } TimerTrace trace = traces.FirstTrace; while (trace != null) { yield return(trace); trace = trace.Next; } }
public void Trace(string message) { TimerTrace t = new TimerTrace(); t.Timestamp = DateTime.Now; t.Message = message; if (lastTrace == null) { lastTrace = traceList.FirstTrace = t; } else { lastTrace.Next = t; lastTrace = t; } traceList.TotalTime = t.Timestamp - traceList.FirstTrace.Timestamp; }