The getScriptTimeout method of the Server class returns an integer that represents the amount of time that can pass before scripts will become invalid.
public int getScriptTimeout();