From a5f31dba5f377540dabff1e17e7e9bf8acafbbf6 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 24 Sep 2015 17:56:11 +0200 Subject: [PATCH] Fix startup timer --- interface/src/Application.cpp | 14 ++++---------- interface/src/Application.h | 2 -- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ef179c65f3..e0892a90eb 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -321,7 +321,7 @@ Cube3DOverlay* _keyboardFocusHighlight{ nullptr }; int _keyboardFocusHighlightID{ -1 }; PluginContainer* _pluginContainer; -Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : +Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : QApplication(argc, argv), _dependencyManagerIsSetup(setupEssentials(argc, argv)), _window(new MainWindow(desktop())), @@ -330,7 +330,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : _undoStackScriptingInterface(&_undoStack), _frameCount(0), _fps(60.0f), - _justStarted(true), _physicsEngine(new PhysicsEngine(Vectors::ZERO)), _entities(true, this, this), _entityClipboardRenderer(false, this, this), @@ -385,8 +384,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : _myAvatar = DependencyManager::get()->getMyAvatar(); - _applicationStartupTime = startup_time; - qCDebug(interfaceapp) << "[VERSION] Build sequence: " << qPrintable(applicationVersion()); _bookmarks = new Bookmarks(); // Before setting up the menu @@ -765,6 +762,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : }); connect(this, &Application::applicationStateChanged, this, &Application::activeChanged); + + + qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0f); } void Application::aboutToQuit() { @@ -959,12 +959,6 @@ void Application::initializeGL() { idleTimer->start(TARGET_SIM_FRAME_PERIOD_MS); _idleLoopStdev.reset(); - if (_justStarted) { - float startupTime = (float)_applicationStartupTime.elapsed() / 1000.0f; - _justStarted = false; - qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTime); - } - // update before the first render update(1.0f / _fps); diff --git a/interface/src/Application.h b/interface/src/Application.h index 0501b2c34d..c879dbf0ce 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -522,10 +522,8 @@ private: int _frameCount; float _fps; - QElapsedTimer _applicationStartupTime; QElapsedTimer _timerStart; QElapsedTimer _lastTimeUpdated; - bool _justStarted; ShapeManager _shapeManager; PhysicalEntitySimulation _entitySimulation;