Пример #1
0
        public void Stop(string name)
        {
            TimeVar t = m_timeVarMap[name];

            if (t == null)
            {
                return;
            }
            t.stop();
        }
Пример #2
0
        public void RemoveTimer(string name)
        {
            TimeVar t = m_timeVarMap[name];

            if (t != null)
            {
                m_timeVarMap.Remove(name);
            }
            m_listTimerName.Remove(name);
        }
Пример #3
0
 public void AppendTimeVar(TimeVar tv)
 {
     lock (m_mutex) {
         if (!ContainsTimer(tv.Name))
         {
             AddTimer(tv.Name);
         }
         TimeVar t = m_timeVarMap[tv.Name];
         t.Merge(tv);
     }
 }
Пример #4
0
 public void Report()
 {
     Console.WriteLine("\nTime Report:");
     foreach (string timername in m_listTimerName)
     {
         TimeVar t = m_timeVarMap[timername];
         if ((t != null) && t.isUse())
         {
             t.report();
         }
     }
 }
Пример #5
0
 public void Merge(TimeVar tm)
 {
     m_elapsed.m_time += tm.m_elapsed.m_time;
     m_count          += tm.m_count;
 }
Пример #6
0
 public void AddTimer(string name)
 {
     m_timeVarMap[name] = new TimeVar(name);
     m_listTimerName.Add(name);
 }