Sleep Execution in the Delegated Admin Extensions Hooks
Last Updated:
Overview
Applies To
- Delegated Admin Extensions
- Other Javascript scripts that do not support setTimer and sleep
Cause
Solution
var milliseconds = 10000;
var date = new Date();
var curDate = null;
while(curDate-date < milliseconds){
curDate = new Date();
}
In the above snippet, "milliseconds" is the number of milliseconds the execution should be paused. The execution pause should not be too long, as an error may be received if it takes too long.It is also highly recommended to use this only for testing purposes and in no way for the end result of the Hooks.
Related References
- Click here for more general documentation regarding Delegated Admin Extensions Hooks.