Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Code Block
languagejs
var result = Script.Timeout(function() {
  // Endless loop
  while(true) {};
}, 1000);