Ejemplo n.º 1
0
        private IndexableQueue <_TicksWithCount> _TicksHistory; // 历史计时计数队列。

        #endregion

        #region 构造函数

        /// <summary>
        /// 使用指定的采样时间间隔初始化 FrequencyCounter 的新实例。
        /// </summary>
        /// <param name="deltaTSeconds">采样时间间隔(秒)。</param>
        public FrequencyCounter(double deltaTSeconds)
        {
            if (double.IsNaN(deltaTSeconds) || double.IsInfinity(deltaTSeconds) || deltaTSeconds <= 0)
            {
                throw new ArgumentException();
            }

            //

            _DeltaTTicks  = Math.Max(1, (long)Math.Round(deltaTSeconds * _TicksPerSecond));
            _TicksHistory = new IndexableQueue <_TicksWithCount>(32, false);
        }
Ejemplo n.º 2
0
 internal Enumerator(IndexableQueue <T> queue)
 {
     _Queue = queue;
     _Index = -1;
 }