CmisSync.Lib.Streams.BandwidthNotifyingStream.CalculateBandwidth C# (CSharp) Method

CalculateBandwidth() private method

Calculates the bandwidth.
private CalculateBandwidth ( int transmittedBytes ) : void
transmittedBytes int /// Transmitted bytes. ///
return void
        private void CalculateBandwidth(int transmittedBytes) {
            this.bytesTransmittedSinceLastSecond += transmittedBytes;
            var diff = DateTime.Now - this.start;
            if (diff.Seconds >= 1) {
                this.BitsPerSecond = CalcBitsPerSecond(this.start, DateTime.Now, this.bytesTransmittedSinceLastSecond);
                this.bytesTransmittedSinceLastSecond = 0;
                this.start += diff;
                this.blockingDetectionTimer.Stop();
                this.blockingDetectionTimer.Start();
            }
        }
    }