Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1284,7 +1284,8 @@ void ScriptEngine::timerFired() { · 1283 unmodified lines | |||
| 1284 | 1284 | ||
| 1285 | // call the associated JS function, if it exists | 1285 | // call the associated JS function, if it exists |
| 1286 | if (timerData.function.isValid()) { | 1286 | if (timerData.function.isValid()) { |
| 1287 | PROFILE_RANGE(script, __FUNCTION__); | 1287 | //PROFILE_RANGE(script, __FUNCTION__); |
| 1288 | PROFILE_RANGE(script, timerData.function.toString().toStdString().c_str()); | ||
| 1288 | auto preTimer = p_high_resolution_clock::now(); | 1289 | auto preTimer = p_high_resolution_clock::now(); |
| 1289 | callWithEnvironment(timerData.definingEntityIdentifier, timerData.definingSandboxURL, timerData.function, timerData.function, QScriptValueList()); | 1290 | callWithEnvironment(timerData.definingEntityIdentifier, timerData.definingSandboxURL, timerData.function, timerData.function, QScriptValueList()); |
| 1290 | auto postTimer = p_high_resolution_clock::now(); | 1291 | auto postTimer = p_high_resolution_clock::now(); |
| @@ -1311,6 +1312,7 @@ QObject* ScriptEngine::setupTimerWithInterval(const QScriptValue& function, int · 20 unmodified lines | |||
| 1311 | // make sure the timer stops when the script does | 1312 | // make sure the timer stops when the script does |
| 1312 | connect(this, &ScriptEngine::scriptEnding, newTimer, &QTimer::stop); | 1313 | connect(this, &ScriptEngine::scriptEnding, newTimer, &QTimer::stop); |
| 1313 | 1314 | ||
| 1315 | |||
| 1314 | CallbackData timerData = { function, currentEntityIdentifier, currentSandboxURL }; | 1316 | CallbackData timerData = { function, currentEntityIdentifier, currentSandboxURL }; |
| 1315 | _timerFunctionMap.insert(newTimer, timerData); | 1317 | _timerFunctionMap.insert(newTimer, timerData); |
| 1316 | 1318 | ||