/// <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; }
/// <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(); }