From 4e4558f2c2a6c0a068fdf7f487be71b2e7c330ed Mon Sep 17 00:00:00 2001 From: Neloreck Date: Mon, 20 Jan 2025 01:16:24 +0200 Subject: [PATCH] Export `start_sampling_mode` as variant with and without interval parameter. --- src/xrScriptEngine/ScriptEngineScript.cpp | 4 ++++ src/xrScriptEngine/script_profiler.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xrScriptEngine/ScriptEngineScript.cpp b/src/xrScriptEngine/ScriptEngineScript.cpp index d0b40239cc4..0d771a72882 100644 --- a/src/xrScriptEngine/ScriptEngineScript.cpp +++ b/src/xrScriptEngine/ScriptEngineScript.cpp @@ -192,6 +192,10 @@ SCRIPT_EXPORT(CScriptEngine, (), { GEnv.ScriptEngine->m_profiler->startHookMode(); }), + def("start_sampling_mode", +[]() + { + GEnv.ScriptEngine->m_profiler->startSamplingMode(); + }), def("start_sampling_mode", +[](u32 sampling_interval = CScriptProfiler::PROFILE_SAMPLING_INTERVAL_DEFAULT) { GEnv.ScriptEngine->m_profiler->startSamplingMode(sampling_interval); diff --git a/src/xrScriptEngine/script_profiler.hpp b/src/xrScriptEngine/script_profiler.hpp index d3321f11c8c..46086938087 100644 --- a/src/xrScriptEngine/script_profiler.hpp +++ b/src/xrScriptEngine/script_profiler.hpp @@ -52,7 +52,7 @@ class XRSCRIPTENGINE_API CScriptProfiler void start(CScriptProfilerType profiler_type = PROFILE_TYPE_DEFAULT); void startHookMode(); - void startSamplingMode(u32 sampling_interval); + void startSamplingMode(u32 sampling_interval = PROFILE_SAMPLING_INTERVAL_DEFAULT); void stop(); void reset(); void logReport(u32 entries_limit = PROFILE_ENTRIES_LOG_LIMIT_DEFAULT);