Skip to main content

Function: assertTimerMs()

assertTimerMs(name, value, options?): number

Defined in: packages/workflow-engine/src/kernel/helpers/host-support.ts:58

Checks a host option that ends up in setTimeout or setInterval and returns it. A timer cannot honour anything else than a finite number of milliseconds up to MAX_TIMER_MS: Infinity, NaN, a negative number or a value above it fires after 1 ms (Node logs a TimeoutOverflowWarning), which turns a bound meant as "no limit" into the tightest one and an interval into a busy loop. So it is refused, at construction, with a RangeError that names the option.

allowZero is for an option whose documented 0 means "off" (the caller then does not start a timer at all). hint is appended to the message.

Parameters​

name​

string

value​

unknown

options?​

allowZero?​

boolean

hint?​

string

Returns​

number