Changeset 1063 for code/trunk/src/orxonox/tools
- Timestamp:
- Apr 14, 2008, 6:23:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/tools/Timer.cc
r1062 r1063 108 108 // It's time to call the function 109 109 if (this->bLoop_) 110 // Q: Why '+=' and not '='? A: Think about it. It's more accurate like that. Seriously. 111 this->time_ += this->interval_; 110 { 111 this->time_ += this->interval_; // Q: Why '+=' and not '='? A: Think about it. It's more accurate like that. Seriously. 112 while (this->time_ <= 0) 113 { 114 // The interval was shorter than one tick, so execute the function more than once 115 this->run(); 116 this->time_ += this->interval_; 117 } 118 } 112 119 else 113 120 this->stopTimer(); // Stop the timer if we don't want to loop … … 117 124 } 118 125 } 119 120 126 }
Note: See TracChangeset
for help on using the changeset viewer.