History

audit use of QTimer intervals to make sure we're using Qt::PreciseTimer when appropriate

Brad Hefta-Gaub committed 9 years ago

Commit a72f6011 parent b56a15b15 files · +35 −21Browse files

Showing the changes to interface/src/Application.cpp (1 of 15 files). Show all

Unified · Split

interface/src/Application.cpp+6−6
@@ -1135,7 +1135,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1134 unmodified lines
11351135 connect(&_settingsThread, SIGNAL(finished()), &_settingsTimer, SLOT(stop()));
11361136 _settingsTimer.moveToThread(&_settingsThread);
11371137 _settingsTimer.setSingleShot(false);
1138− _settingsTimer.setInterval(SAVE_SETTINGS_INTERVAL);
1138+ _settingsTimer.setInterval(SAVE_SETTINGS_INTERVAL); // 10s, Qt::CoarseTimer acceptable
11391139 _settingsThread.start();
11401140
11411141 if (Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson)) {
@@ -1240,7 +1240,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 98 unmodified lines
12401240
12411241 // Periodically send fps as a user activity event
12421242 QTimer* sendStatsTimer = new QTimer(this);
1243− sendStatsTimer->setInterval(SEND_STATS_INTERVAL_MS);
1243+ sendStatsTimer->setInterval(SEND_STATS_INTERVAL_MS); // 10s, Qt::CoarseTimer acceptable
12441244 connect(sendStatsTimer, &QTimer::timeout, this, [this]() {
12451245
12461246 QJsonObject properties = {};
@@ -1341,7 +1341,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 94 unmodified lines
13411341 // Periodically check for count of nearby avatars
13421342 static int lastCountOfNearbyAvatars = -1;
13431343 QTimer* checkNearbyAvatarsTimer = new QTimer(this);
1344− checkNearbyAvatarsTimer->setInterval(CHECK_NEARBY_AVATARS_INTERVAL_MS);
1344+ checkNearbyAvatarsTimer->setInterval(CHECK_NEARBY_AVATARS_INTERVAL_MS); // 10 seconds, Qt::CoarseTimer ok
13451345 connect(checkNearbyAvatarsTimer, &QTimer::timeout, this, [this]() {
13461346 auto avatarManager = DependencyManager::get<AvatarManager>();
13471347 int nearbyAvatars = avatarManager->numberOfAvatarsInRange(avatarManager->getMyAvatar()->getPosition(),
@@ -1499,16 +1499,16 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 151 unmodified lines
14991499
15001500 // Monitor model assets (e.g., from Clara.io) added to the world that may need resizing.
15011501 static const int ADD_ASSET_TO_WORLD_TIMER_INTERVAL_MS = 1000;
1502− _addAssetToWorldResizeTimer.setInterval(ADD_ASSET_TO_WORLD_TIMER_INTERVAL_MS);
1502+ _addAssetToWorldResizeTimer.setInterval(ADD_ASSET_TO_WORLD_TIMER_INTERVAL_MS); // 1s, Qt::CoarseTimer acceptable
15031503 connect(&_addAssetToWorldResizeTimer, &QTimer::timeout, this, &Application::addAssetToWorldCheckModelSize);
15041504
15051505 // Auto-update and close adding asset to world info message box.
15061506 static const int ADD_ASSET_TO_WORLD_INFO_TIMEOUT_MS = 5000;
1507− _addAssetToWorldInfoTimer.setInterval(ADD_ASSET_TO_WORLD_INFO_TIMEOUT_MS);
1507+ _addAssetToWorldInfoTimer.setInterval(ADD_ASSET_TO_WORLD_INFO_TIMEOUT_MS); // 5s, Qt::CoarseTimer acceptable
15081508 _addAssetToWorldInfoTimer.setSingleShot(true);
15091509 connect(&_addAssetToWorldInfoTimer, &QTimer::timeout, this, &Application::addAssetToWorldInfoTimeout);
15101510 static const int ADD_ASSET_TO_WORLD_ERROR_TIMEOUT_MS = 8000;
1511− _addAssetToWorldErrorTimer.setInterval(ADD_ASSET_TO_WORLD_ERROR_TIMEOUT_MS);
1511+ _addAssetToWorldErrorTimer.setInterval(ADD_ASSET_TO_WORLD_ERROR_TIMEOUT_MS); // 8s, Qt::CoarseTimer acceptable
15121512 _addAssetToWorldErrorTimer.setSingleShot(true);
15131513 connect(&_addAssetToWorldErrorTimer, &QTimer::timeout, this, &Application::addAssetToWorldErrorTimeout);
15141514

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t