Fix startup timer

This commit is contained in:
Atlante45 2015-09-24 17:56:11 +02:00
parent 0aab013a0e
commit a5f31dba5f
2 changed files with 4 additions and 12 deletions

View file

@ -321,7 +321,7 @@ Cube3DOverlay* _keyboardFocusHighlight{ nullptr };
int _keyboardFocusHighlightID{ -1 }; int _keyboardFocusHighlightID{ -1 };
PluginContainer* _pluginContainer; PluginContainer* _pluginContainer;
Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
QApplication(argc, argv), QApplication(argc, argv),
_dependencyManagerIsSetup(setupEssentials(argc, argv)), _dependencyManagerIsSetup(setupEssentials(argc, argv)),
_window(new MainWindow(desktop())), _window(new MainWindow(desktop())),
@ -330,7 +330,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
_undoStackScriptingInterface(&_undoStack), _undoStackScriptingInterface(&_undoStack),
_frameCount(0), _frameCount(0),
_fps(60.0f), _fps(60.0f),
_justStarted(true),
_physicsEngine(new PhysicsEngine(Vectors::ZERO)), _physicsEngine(new PhysicsEngine(Vectors::ZERO)),
_entities(true, this, this), _entities(true, this, this),
_entityClipboardRenderer(false, this, this), _entityClipboardRenderer(false, this, this),
@ -385,8 +384,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
_myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar(); _myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
_applicationStartupTime = startup_time;
qCDebug(interfaceapp) << "[VERSION] Build sequence: " << qPrintable(applicationVersion()); qCDebug(interfaceapp) << "[VERSION] Build sequence: " << qPrintable(applicationVersion());
_bookmarks = new Bookmarks(); // Before setting up the menu _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); connect(this, &Application::applicationStateChanged, this, &Application::activeChanged);
qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0f);
} }
void Application::aboutToQuit() { void Application::aboutToQuit() {
@ -959,12 +959,6 @@ void Application::initializeGL() {
idleTimer->start(TARGET_SIM_FRAME_PERIOD_MS); idleTimer->start(TARGET_SIM_FRAME_PERIOD_MS);
_idleLoopStdev.reset(); _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 before the first render
update(1.0f / _fps); update(1.0f / _fps);

View file

@ -522,10 +522,8 @@ private:
int _frameCount; int _frameCount;
float _fps; float _fps;
QElapsedTimer _applicationStartupTime;
QElapsedTimer _timerStart; QElapsedTimer _timerStart;
QElapsedTimer _lastTimeUpdated; QElapsedTimer _lastTimeUpdated;
bool _justStarted;
ShapeManager _shapeManager; ShapeManager _shapeManager;
PhysicalEntitySimulation _entitySimulation; PhysicalEntitySimulation _entitySimulation;