bool reset = false; if( _ClipBandwidth && start + TimeSpan.FromSeconds( 1.0 ) < DateTime.Now ) { reset = true; } else if( _ClipBandwidth && _MaxBandwidth == 0 ) { while( _MaxBandwidth == 0 ) { Thread.Sleep( 500 ); } reset = true; } else if( _ClipBandwidth && sent > _MaxBandwidth ) { int toSleep = 1000 - ( DateTime.Now.Millisecond - start.Millisecond ); Thread.Sleep( toSleep ); reset = true; } if( reset ) { sent = 0; start = DateTime.Now; }