All pastes #95341 Raw Edit

Mine

public text v1 · immutable
#95341 ·published 2006-07-21 22:43 UTC
rendered paste body
                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;
                }