Exemple #1
0
        public Timer(System.TimeSpan frequency, bool shouldDispose = true)
            : base(shouldDispose)
        {
            m_Frequency = frequency;

            Producer = new Common.Collections.Generic.ConcurrentLinkedQueueSlim <long>();

            m_Counter = new System.Threading.Thread(new System.Threading.ThreadStart(Count))
            {
                Priority = System.Threading.ThreadPriority.AboveNormal
            };

            m_Counter.TrySetApartmentState(System.Threading.ApartmentState.MTA);

            Tick = delegate { unchecked { m_Ops += 1 + m_Bias; } };
        }