Scheduler
[<Interface>]
type Scheduler =
static member Create (wait: Func<float,Options option,Promise<unit>>, yield: unit -> Promise<unit>) : Scheduler
abstract member ``yield`` () : Promise<unit>
abstract member wait (delay: float, ?options: Options) : Promise<unit>| Assembly | Xantham.Fable.Node |
| Attributes | [<Interface>] |
Declared inside
Wait |
Methods
static member Create (wait: Func<float,Options option,Promise<unit>>, yield: unit -> Promise<unit>) : Schedulerabstract member ``yield`` () : Promise<unit>
abstract member ``yield`` () : Promise<unit>An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments.
@since v17.3.0, v16.14.0
abstract member wait (delay: float, ?options: Options) : Promise<unit>
abstract member wait (delay: float, ?options: Options) : Promise<unit>An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API.
Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported.
import { scheduler } from 'node:timers/promises';
await scheduler.wait(1000); // Wait one second before continuing
@since v17.3.0, v16.14.0
| Parameter | |
|---|---|
delay | The number of milliseconds to wait before resolving the promise. |