|
LuaSandbox::pauseUsageTimerPause the CPU usage timer Description
public bool LuaSandbox::pauseUsageTimer()
Pauses the CPU usage timer. This only has effect when called from within a callback from Lua. When execution returns to Lua, the timer will be automatically unpaused. If a new call into Lua is made, the timer will be unpaused for the duration of that call. If a PHP callback calls into Lua again with timer not paused, and then that Lua function calls into PHP again, the second PHP call will not be able to pause the timer. The logic is that even though the second PHP call would avoid counting the CPU usage against the limit, the first call still counts it. ParametersThis function has no parameters. Return ValuesReturns a bool indicating whether the timer is now paused. Examples
Example #1 Manipulating the usage timer
The above example will output: This should not time out... This should time out. It did! The maximum execution time for this script was exceeded See Also
|