Changeset 8015 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- May 31, 2006, 10:43:16 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/connection_monitor.cc
r7974 r8015 75 75 76 76 // count zero bytes 77 int nZeroBytes = 0;78 79 for ( int i = 0; i < length; i++ )80 if ( data[i] == '\0' )81 nZeroBytes++;77 //int nZeroBytes = 0; 78 79 //for ( int i = 0; i < length; i++ ) 80 // if ( data[i] == '\0' ) 81 // nZeroBytes++; 82 82 83 83 //NETPRINTF(n)( "ZEROBYTES: %d (%f%%)\n", nZeroBytes, ((float)100)*nZeroBytes/length ); … … 145 145 for ( std::map<int,int>::iterator it = packetHistory.begin(); it != packetHistory.end(); it++ ) 146 146 { 147 res += it->second; 147 if ( it != packetHistory.begin() ) 148 res += it->second; 148 149 } 149 150 … … 151 152 res = 0.0f; 152 153 else 153 res /= (float)( (tick - packetHistory.begin()->first)*( 1 + 1/((float)(packetHistory.size()-1)) ));154 res /= (float)(tick - packetHistory.begin()->first); 154 155 155 156 res *= 1000.0f;
Note: See TracChangeset
for help on using the changeset viewer.