public void ConcurrentInt64GetAndReset()
        {
            var c      = new ConcurrentInt64(22);
            var result = c.GetAndReset();

            Assert.AreEqual(result, 22);
            Assert.AreEqual(0, (Int64)c);
        }
Esempio n. 2
0
 internal void Calculate()
 {
     if (!_container.Cumulative)
     {
         Value = _internalRunCount.GetAndReset();
         Max   = _internalMax.GetAndSet(0);
         Min   = _internalMax.GetAndSet(0);
         var intervals = _container.GetInterval(_container.LastCalculation);
         Avg = _container.GetAvg(Value, intervals);
     }
     else
     {
         Max   = _internalMax.Value;
         Min   = _internalMax.Value;
         Value = _internalRunCount.Value;
         Avg   = _container.GetAvg(Value);
     }
 }