Skip to main content

_END

Timestamp of the latest possible end of the top-level script execution.

_END is a global variable that provides a timestamp, in milliseconds since the Unix epoch, of when the script execution is guaranteed to end due to a timeout. This number is effectively _START + _TIMEOUT.

Syntax

_END;

Example

A script that wants to check how close it is to timing out can use _END instead of _START + _TIMEOUT or scripts.lib's can_continue_execution:

function(context, args) {
// do stuff

if(_END - Date.now() < 500){
return "Less than 500ms left! Bailing!"
}

// do more stuff

return "Script completed without timing out"
}