Esempio n. 1
0
 /// <summary>
 /// stops the previously started timer
 /// </summary>
 public void Stop()
 {
     Debug.Assert(current != null);
     if (current == null)
     {
         return;
     }
     current.Stop();
     activeTimers.Enqueue(current);
     current = null;
 }
Esempio n. 2
0
        /// <summary>
        /// starts the next timer
        /// </summary>
        public void Start()
        {
            Debug.Assert(current == null);

            // get next free timer
            if (cache.Count > 0)
            {
                current = cache.Pop();
            }
            else
            {
                current = new GpuTimer();
            }

            current.Start();
        }