Skip to content

Commit a8d859c

Browse files
committed
perf: perf debug disabled by default
#1032
1 parent 3212db8 commit a8d859c

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

config/DebugChannels.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
<DebugChannel active="false" name="DBG_MULTIPLAYER" text="multiplayer"/>
2222
<DebugChannel active="true" name="DBG_IMPLEMENTS" text="implements"/>
2323
<DebugChannel active="false" name="DBG_AI_DRIVER" text="ai common"/>
24-
<DebugChannel active="true" name="DBG_PERF" text="perf"/>
24+
<DebugChannel active="false" name="DBG_PERF" text="perf"/>
2525
</DebugChannels>

scripts/util/Profiler.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
--[[
2+
Profiler class to measure execution time of code blocks.
3+
Usage:
4+
local profiler = Profiler:new(vehicle, 100) -- 100 optional, the size of the moving average window
5+
profiler:start()
6+
-- code to be profiled
7+
profiler:stop()
8+
profiler:log() -- log the profiling results when DBG_PERF is enabled
9+
profiler:render() -- render the profiling results on screen when DBG_PERF is enabled
10+
]]
111
Profiler = CpObject()
212

313
function Profiler:init(vehicle, n)

0 commit comments

Comments
 (0)