Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Overview

Executes the given callback function at maximum in the given milliseconds.

( "null" | object ) myScript.Timeout(fn: () => void, milliseconds: number)

Arguments

() => void fn
The callback to execute.
number milliseconds
The maximum milliseconds to execute the callback.

Remarks

When function completed in the given milliseconds, the function returns the callback result, otherwise returns null.

Example

var result = Script.Timeout(function() {
  // Endless loop
  while(true) {};
}, 1000);
  • No labels