mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:09:52 +02:00
Adding the function source when profiling, to explore perf issues
This commit is contained in:
parent
86b2382f7c
commit
bda52c33e6
1 changed files with 3 additions and 1 deletions
|
@ -1284,7 +1284,8 @@ void ScriptEngine::timerFired() {
|
||||||
|
|
||||||
// call the associated JS function, if it exists
|
// call the associated JS function, if it exists
|
||||||
if (timerData.function.isValid()) {
|
if (timerData.function.isValid()) {
|
||||||
PROFILE_RANGE(script, __FUNCTION__);
|
//PROFILE_RANGE(script, __FUNCTION__);
|
||||||
|
PROFILE_RANGE(script, timerData.function.toString().toStdString().c_str());
|
||||||
auto preTimer = p_high_resolution_clock::now();
|
auto preTimer = p_high_resolution_clock::now();
|
||||||
callWithEnvironment(timerData.definingEntityIdentifier, timerData.definingSandboxURL, timerData.function, timerData.function, QScriptValueList());
|
callWithEnvironment(timerData.definingEntityIdentifier, timerData.definingSandboxURL, timerData.function, timerData.function, QScriptValueList());
|
||||||
auto postTimer = p_high_resolution_clock::now();
|
auto postTimer = p_high_resolution_clock::now();
|
||||||
|
@ -1311,6 +1312,7 @@ QObject* ScriptEngine::setupTimerWithInterval(const QScriptValue& function, int
|
||||||
// make sure the timer stops when the script does
|
// make sure the timer stops when the script does
|
||||||
connect(this, &ScriptEngine::scriptEnding, newTimer, &QTimer::stop);
|
connect(this, &ScriptEngine::scriptEnding, newTimer, &QTimer::stop);
|
||||||
|
|
||||||
|
|
||||||
CallbackData timerData = { function, currentEntityIdentifier, currentSandboxURL };
|
CallbackData timerData = { function, currentEntityIdentifier, currentSandboxURL };
|
||||||
_timerFunctionMap.insert(newTimer, timerData);
|
_timerFunctionMap.insert(newTimer, timerData);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue