Example #1
0
        public IDisposable Time(string key)
        {
            AutoTimer timer;

            lock (_timersSyncObject)
            {
                if (_timers.ContainsKey(key))
                {
                    timer = _timers[key];
                    timer.Resume();
                }
                else
                {
                    timer = _timers[key] = new AutoTimer();
                }
            }

            return(timer);
        }
Example #2
0
        public IDisposable Time(string key)
        {
            key = string.Format("TimeElapsed_{0}", key);

            lock (_timersSyncObject)
            {
                if (!_timers.ContainsKey(key))
                {
                    _timers[key] = new AutoTimer();
                }

                return _timers[key];
            }
        }