Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 13 files). Show all
Unified · Split
| @@ -1117,6 +1117,7 @@ void ScriptManager::timerFired() { · 1116 unmodified lines | ||
| 1117 | 1117 | return; // bail early |
| 1118 | 1118 | } |
| 1119 | 1119 | |
| 1120 | +#ifdef SCRIPT_TIMER_PERFORMANCE_STATISTICS | |
| 1120 | 1121 | _timerCallCounter++; |
| 1121 | 1122 | if (_timerCallCounter % 100 == 0) { |
| 1122 | 1123 | qCDebug(scriptengine) << "Script engine: " << _engine->manager()->getFilename() |
| @@ -1124,6 +1125,7 @@ void ScriptManager::timerFired() { · 1 unmodified line | ||
| 1124 | 1125 | } |
| 1125 | 1126 | QElapsedTimer callTimer; |
| 1126 | 1127 | callTimer.start(); |
| 1128 | +#endif | |
| 1127 | 1129 | |
| 1128 | 1130 | QTimer* callingTimer = reinterpret_cast<QTimer*>(sender()); |
| 1129 | 1131 | CallbackData timerData = _timerFunctionMap.value(callingTimer); |
| @@ -1146,7 +1148,9 @@ void ScriptManager::timerFired() { · 16 unmodified lines | ||
| 1146 | 1148 | qCWarning(scriptengine) << "timerFired -- invalid function" << timerData.function.toVariant().toString(); |
| 1147 | 1149 | } |
| 1148 | 1150 | |
| 1151 | +#ifdef SCRIPT_TIMER_PERFORMANCE_STATISTICS | |
| 1149 | 1152 | _totalTimeInTimerEvents_s += callTimer.elapsed() / 1000.0; |
| 1153 | +#endif | |
| 1150 | 1154 | } |
| 1151 | 1155 | |
| 1152 | 1156 | QTimer* ScriptManager::setupTimerWithInterval(const ScriptValue& function, int intervalMS, bool isSingleShot) { |