CmisSync.Lib.Streams.BandwidthNotifyingStream.CalculateBandwidth C# (CSharp) 메소드

CalculateBandwidth() 개인적인 메소드

Calculates the bandwidth.
private CalculateBandwidth ( int transmittedBytes ) : void
transmittedBytes int /// Transmitted bytes. ///
리턴 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();
            }
        }
    }