mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +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
|
||||
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();
|
||||
callWithEnvironment(timerData.definingEntityIdentifier, timerData.definingSandboxURL, timerData.function, timerData.function, QScriptValueList());
|
||||
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
|
||||
connect(this, &ScriptEngine::scriptEnding, newTimer, &QTimer::stop);
|
||||
|
||||
|
||||
CallbackData timerData = { function, currentEntityIdentifier, currentSandboxURL };
|
||||
_timerFunctionMap.insert(newTimer, timerData);
|
||||
|
||||
|
|
Loading…
Reference in a new issue