Global

Methods

clearTimeout(id)

Clear a timer set with setTimeout.

If the timer didn't expire, this results in delayed function's cancellation.

Parameters:
Name Type Description
id number The ID value of the timer returned by setTimeout.
Since:
  • Version 1.0 (API level 1)
Example
var id = setTimeout(onLockdown, 3000);
clearTimeout(id);

function onLockdown() {
    // This code is unreachable, since the timeout was cleared
    mobicontrol.log.info('In lockdown');
}

async setTimeout(delayedFunction, delayopt) → {number}

Call a function after the specified number of milliseconds.
Parameters:
Name Type Attributes Default Description
delayedFunction setTimeoutCallback JavaScript function to be executed.
delay number <optional>
0 Delay in milliseconds.
Returns:
number - A unique ID of the function's timer. Use this value with clearTimeout to cancel the function execution before the timer expires.
Since:
  • Version 1.0 (API level 1)
Example
mobicontrol.lockdown.enable();
setTimeout(onLockdown, 3000);

function onLockdown() {
   mobicontrol.log.info('In lockdown');
   // Lockdown is now enabled. You can add code which relies on the device being in Lockdown state.
}

Type Definitions

setTimeoutCallback()

Callback function for setTimeout.
Since:
  • Version 1.0 (API level 1)