internal static TimeSpan GetTimerTimeSpan(string name)
 {
     if (TimerDictionary.ContainsKey(name))
     {
         DiagTimer t = TimerDictionary[name];
         return(t.Duration);
     }
     else
     {
         return(new TimeSpan(0));
     }
 }
 public static string GetTimer(string name)
 {
     if (TimerDictionary.ContainsKey(name))
     {
         DiagTimer t   = TimerDictionary[name];
         string    msg = "Timer: " + name + " " + t.GetDiagString();
         return(msg);
     }
     else
     {
         return("Error: " + name + " Not Found");
     }
 }
        public static bool StopTimer(string name)
        {
            DiagTimer t = TimerDictionary[name];

            if (t != null)
            {
                t.Stop();
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public static void StartTimer(string name)
        {
            DiagTimer t = new DiagTimer();

            if (!TimerDictionary.ContainsKey(name))
            {
                TimerDictionary.Add(name, t);
            }
            else // reset the named timer
            {
                TimerDictionary.Remove(name);
                TimerDictionary.Add(name, t);
            }
        }
        public static string StopAndGetTimer(string name)
        {
            DiagTimer t = TimerDictionary[name];

            if (t != null)
            {
                t.Stop();
                return(GetTimer(name));
            }
            else
            {
                return("Error: " + name + " Not Found");
            }
        }