Skip to content
FutureBlitz

    Install

    Import std.time.clock

    Sleep

    std.time.clock

    function

    Public Function Sleep(time: Duration)

    Blocks the thread for that long, and returns at once for a Duration that isn't above 0. In Async code, Await Wait or Timer.After waits without blocking.

    Examples

    Local before = Instant.Now()
    Sleep(1.Milliseconds)
    Expect(before.Elapsed >= 1.Milliseconds)

    std/time/clock.fb, line 188

    Report an issue with this page or with FutureBlitz on GitHub.