Skip to main content

runDelayedScript

runDelayedScript

Runs a function once after the delay you specify.

Parameters

  • milliSeconds (number): How long to wait before running the function, in milliseconds
  • function (function): The function to run after the delay

Returns: None (void)

Description

Sets a timer and calls function once after milliSeconds elapses. Use it to defer arbitrary logic rather than a message.

warning

If the timer expires before the form closes, the function runs. Automatic cancellation after dispose is not supported, so take care.

Example

// 1초 후 실행
$form.runDelayedScript(1000, function() {
$log.i("1초 후 실행됨");
});

// 3초 후 자동 닫기
$form.runDelayedScript(3000, function() {
$form.close(null);
});

Related

  • $form.postDelayedMessage(name, data, target, milliSeconds) — sends a message after a delay