Beispiel #1
0
 public void Start()
 {
     if (LastAction == null)
     {
         LastAction = new TickCounter();
     }
     else
     {
         LastAction.SetNow();
     }
 }
Beispiel #2
0
        private void UpdateAggregatedBitrate()
        {
            var windowbitrate = AggregationWindowBitrate();

            AggregatedBitrate = (AggregatedBitrate * EMAAlpha) + windowbitrate * EMAAlphaRes;

            AggregationWindowDataBytes /= 2;
            AggregationWindowStart      = TickCounter.Now - AggregationWindowMilliseconds / 2;

            if (EMAAlpha < EMAAlphaMax)
            {
                UpdateAlpha(EMAAlpha + 0.05f);
            }
        }
Beispiel #3
0
 public void Stop()
 {
     LastAction = null;
 }
Beispiel #4
0
 public void Reset()
 {
     LastAction = new TickCounter();
 }
Beispiel #5
0
 protected PeriodicAction(int freqmsec, bool hastimedout)
 {
     mFrequencyMilliSeconds = freqmsec;
     Autotrigger            = hastimedout;
     LastAction             = new TickCounter();
 }
Beispiel #6
0
 public static TickSpan TimeDelta(TickCounter end, TickCounter start)
 {
     return(new TickSpan(TimeDeltaMS(end.TickCount, start.TickCount)));
 }