Index: /code/branches/netp6/src/core/Clock.cc
===================================================================
--- /code/branches/netp6/src/core/Clock.cc	(revision 3288)
+++ /code/branches/netp6/src/core/Clock.cc	(revision 3289)
@@ -59,5 +59,5 @@
         tickDtFloat_ = static_cast<float>(tickDt_) / 1000000.0f;
 
-        if (timersTime > 0x7FFFFFF0)
+        if (timersTime > 0xFFFFFFFF/4)
         {
             // Ogre timer will overflow at 2^32 microseconds if unsigned long is 32 bit
@@ -74,5 +74,5 @@
     unsigned long long Clock::getRealMicroseconds() const
     {
-        return this->timer_->getMicroseconds();
+        return this->timer_->getMicroseconds() + this->storedTime_;
     }
 }
Index: /code/branches/netp6/src/core/Game.cc
===================================================================
--- /code/branches/netp6/src/core/Game.cc	(revision 3288)
+++ /code/branches/netp6/src/core/Game.cc	(revision 3289)
@@ -40,4 +40,5 @@
 #include "util/Debug.h"
 #include "util/Exception.h"
+#include "util/Sleep.h"
 #include "util/SubString.h"
 #include "Clock.h"
@@ -120,4 +121,6 @@
         SetConfigValue(levelName_, "presentation_dm.oxw")
             .description("Sets the preselection of the level in the main menu.");
+      SetConfigValue(FPSLimit_, 50)
+            .description("Sets the desired framerate (0 for no limit).");
     }
 
@@ -156,6 +159,13 @@
         while (!this->abort_ && !this->activeStates_.empty())
         {
+            uint64_t currentTime = this->gameClock_->getRealMicroseconds();
+
+            uint64_t nextTickTime = statisticsTickTimes_.back().tickTime + 1000000.f/this->FPSLimit_;
+            if( currentTime < nextTickTime )
+            {
+                usleep( nextTickTime - currentTime );
+                continue;
+            }
             this->gameClock_->capture();
-            uint64_t currentTime = this->gameClock_->getMicroseconds();
 
             // STATISTICS
Index: /code/branches/netp6/src/core/Game.h
===================================================================
--- /code/branches/netp6/src/core/Game.h	(revision 3288)
+++ /code/branches/netp6/src/core/Game.h	(revision 3289)
@@ -131,4 +131,5 @@
         unsigned int                    statisticsRefreshCycle_;
         unsigned int                    statisticsAvgLength_;
+        unsigned int                    FPSLimit_;
         std::string                     levelName_;
 
Index: /code/branches/netp6/src/orxonox/gamestates/GSDedicated.cc
===================================================================
--- /code/branches/netp6/src/orxonox/gamestates/GSDedicated.cc	(revision 3288)
+++ /code/branches/netp6/src/orxonox/gamestates/GSDedicated.cc	(revision 3289)
@@ -58,5 +58,4 @@
         : GameState(name)
         , server_(0)
-        , timeSinceLastUpdate_(0)
         , closeThread_(false)
         , cleanLine_(true)
@@ -109,16 +108,5 @@
     void GSDedicated::update(const Clock& time)
     {
-        timeSinceLastUpdate_ += time.getDeltaTime();
-        //if (timeSinceLastUpdate_ >= NETWORK_PERIOD)
-        {
-            timeSinceLastUpdate_ -= static_cast<unsigned int>(timeSinceLastUpdate_ / NETWORK_PERIOD) * NETWORK_PERIOD;
-            server_->update(time);
-        }
-        /*else
-        {
-            msleep(static_cast<unsigned int>((NETWORK_PERIOD - timeSinceLastUpdate_)*1000));
-            msleep(static_cast<unsigned int>(NETWORK_PERIOD*1000)); // NOTE: this is to throttle the non-network framerate
-//            COUT(0) << "sleeping for " << (int)((NETWORK_PERIOD - timeSinceLastUpdate_) * 1000 * 1000) << " usec" << endl;
-        }*/
+        server_->update(time);
         processQueue();
         printLine();
Index: /code/branches/netp6/src/orxonox/gamestates/GSDedicated.h
===================================================================
--- /code/branches/netp6/src/orxonox/gamestates/GSDedicated.h	(revision 3288)
+++ /code/branches/netp6/src/orxonox/gamestates/GSDedicated.h	(revision 3289)
@@ -66,5 +66,4 @@
         
         Server*                 server_;
-        float                   timeSinceLastUpdate_;
         
         boost::thread           *inputThread_;
