System.setMaxRunTimeSecs
System.setMaxRunTimeSecs($maxRunTimeSecs) -> null
Description
Set the maximum amount of time in seconds that the current page can run before triggering a timeout error.
The value must be greater than zero.
This overrides the app-level config maxRunTimeSecs setting.
Note: Sub-processes like System.sleep, database queries, and system calls do not count toward this limit (this is PHP behavior). As an alternative, may can set timeout limits at the webserver level instead.
SecurityThis should be only be used to extend individual scripts that require a longer execution time for authenticated users (e.g. running reports). Otherwise, you risk exposing your app to DDoS attacks.
System.setMaxRunTimeSecs(20)