metis.timer

Utilities for working with timers.

timeout(The, fn, ...)Run a function, waiting for it to complete or for a timer to expire.
timeout(The, fn, ...)Source

Run a function, waiting for it to complete or for a timer to expire.

This does not terminate a function which is running. It must yield (e.g. pull an event) in order to be interrupted.

Parameters

  1. The number time (in seconds) the function can run for before begin stopped.
  2. fn function The function to run.
  3. ... Arguments to pass to the function.

Returns

  1. true If the function completes without timing out.
  2. ... The return values of the function.

Or

  1. false If the function times out.

Usage