예제 #1
0
 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;
     }
 }
예제 #2
0
        public IEnumerable <TimerTrace> GetTimerTraces()
        {
            TimerTrace trace = traces?.FirstTrace;

            while (trace != null)
            {
                yield return(trace);

                trace = trace.Next;
            }
        }
예제 #3
0
		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;
            }
        }
예제 #5
0
        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;
        }