Classes

The following classes are available globally.

  • An async sequence that emits the current date on a given interval.

    let sequence = TimerAsyncSequence(interval: 1)
    
    let start = Date.now
    for element in await sequence {
        print(element)
    }
    
    // Prints:
    // 2022-03-19 20:49:30 +0000
    // 2022-03-19 20:49:31 +0000
    // 2022-03-19 20:49:32 +0000
    
    See more

    Declaration

    Swift

    public final class TimerAsyncSequence : AsyncSequence