diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-10-20 19:59:40 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-10-20 19:59:40 +0200 |
commit | bde99d684e0bb51adaa053a240abe61cf4af07fb (patch) | |
tree | ad1111d21ee606dd3cd60439189a92b1b51e2dea /src/Root.cpp | |
parent | Migrated random generators to std::random (diff) | |
download | cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.gz cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.bz2 cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.lz cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.xz cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.tar.zst cuberite-bde99d684e0bb51adaa053a240abe61cf4af07fb.zip |
Diffstat (limited to 'src/Root.cpp')
-rw-r--r-- | src/Root.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Root.cpp b/src/Root.cpp index c8a268a78..1271e8648 100644 --- a/src/Root.cpp +++ b/src/Root.cpp @@ -16,7 +16,6 @@ #include "Protocol/ProtocolRecognizer.h" // for protocol version constants #include "CommandOutput.h" #include "DeadlockDetect.h" -#include "OSSupport/Timer.h" #include "LoggerListeners.h" #include "BuildInfo.h" @@ -118,9 +117,7 @@ void cRoot::Start(void) m_bStop = false; while (!m_bStop) { - cTimer Time; - long long mseconds = Time.GetNowTime(); - + auto BeginTime = std::chrono::steady_clock::now(); m_bRestart = false; LoadGlobalSettings(); @@ -200,17 +197,14 @@ void cRoot::Start(void) } #endif - long long finishmseconds = Time.GetNowTime(); - finishmseconds -= mseconds; - - LOG("Startup complete, took %lld ms!", finishmseconds); + LOG("Startup complete, took %lld ms!", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - BeginTime).count()); #ifdef _WIN32 EnableMenuItem(hmenu, SC_CLOSE, MF_ENABLED); // Re-enable close button #endif while (!m_bStop && !m_bRestart && !m_TerminateEventRaised) // These are modified by external threads { - cSleep::MilliSleep(1000); + std::this_thread::sleep_for(std::chrono::seconds(1)); } if (m_TerminateEventRaised) |