- Timestamp:
- Dec 30, 2008, 3:27:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/gamestates/GSDedicated.cc
r2415 r2549 74 74 void GSDedicated::ticked(const Clock& time) 75 75 { 76 // static float startTime = time.getSecondsPrecise(); 77 // static int nrOfTicks = 0; 78 timeSinceLastUpdate_+=time.getDeltaTime(); 79 if(timeSinceLastUpdate_>=NETWORK_PERIOD){ 80 // ++nrOfTicks; 81 // COUT(0) << "estimated ticks/sec: " << nrOfTicks/(time.getSecondsPrecise()-startTime) << endl; 82 timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD; 76 // static float startTime = time.getSecondsPrecise(); 77 // static int nrOfTicks = 0; 78 timeSinceLastUpdate_ += time.getDeltaTime(); 79 if (timeSinceLastUpdate_ >= NETWORK_PERIOD) 80 { 81 // ++nrOfTicks; 82 // COUT(0) << "estimated ticks/sec: " << nrOfTicks/(time.getSecondsPrecise()-startTime) << endl; 83 timeSinceLastUpdate_ -= static_cast<unsigned int>(timeSinceLastUpdate_ / NETWORK_PERIOD) * NETWORK_PERIOD; 83 84 GSLevel::ticked(time); 84 85 server_->tick(time.getDeltaTime()); … … 87 88 else 88 89 { 89 usleep( (int)( (NETWORK_PERIOD - timeSinceLastUpdate_)*1000*1000 ));90 // COUT(0) << "sleeping for " << (int)( (NETWORK_PERIOD - timeSinceLastUpdate_)*1000*1000) << " usec" << endl;90 usleep((int)((NETWORK_PERIOD - timeSinceLastUpdate_) * 1000 * 1000)); 91 // COUT(0) << "sleeping for " << (int)((NETWORK_PERIOD - timeSinceLastUpdate_) * 1000 * 1000) << " usec" << endl; 91 92 } 92 93 }
Note: See TracChangeset
for help on using the changeset viewer.