Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<LuaSandbox::disableProfilerLuaSandbox::getCPUUsage>
^LuaSandboxLast updated: Mon, 26 Oct 2026

LuaSandbox::enableProfiler

(PECL luasandbox >= 1.1.0)

LuaSandbox::enableProfiler — Enable the profiler.

Description

public function LuaSandbox::enableProfiler(float $period = 0.02): bool

Enables the profiler. Profiling will begin when Lua code is entered.

The profiler periodically samples the Lua environment to record the running function. Testing indicates that at least on Linux, setting a period less than 1ms will lead to a high overrun count but no performance problems.

Parameters

period

Sampling period in seconds.

Return Values

Returns a boolean indicating whether the profiler is enabled.

See Also


<LuaSandbox::disableProfilerLuaSandbox::getCPUUsage>
^LuaSandboxLast updated: Mon, 26 Oct 2026