debug.set_script_watchdog_timeout_msec
Defined in module
"debug"from "debug" import set_script_watchdog_timeout_msecSets the script watchdog timeout in milliseconds and returns the previous value
Parameters
timeout_msec | int | milliseconds of wall-clock time a script may run before the watchdog raises an error; 0 turns the watchdog off |
Return value
The timeout that was in effect before this call.
Notes
The watchdog guards against a script that never returns control, such as one caught in an infinite loop. The VM checks the elapsed time periodically while running bytecode, not on every single instruction, and raises a catchable "Watchdog: too long execution of quirrel script" error once the timeout is exceeded. Setting a new timeout also resets the clock, the same as script_watchdog_kick does.
Example
from "debug" import set_script_watchdog_timeout_msec
println("set_script_watchdog_timeout_msec(5000) =", set_script_watchdog_timeout_msec(5000)) // 0: no timeout was set yet
println("set_script_watchdog_timeout_msec(0) =", set_script_watchdog_timeout_msec(0)) // 5000: the value just setOutput:
set_script_watchdog_timeout_msec(5000) = 0
set_script_watchdog_timeout_msec(0) = 5000See also
script_watchdog_kick | Resets the script watchdog timer |
| debug | module index |