Int

extension Int
  • Executes supplied closure n-times. Handy for time measurement tests.

    Declaration

    Swift

    public func times(execute: () -> Void)

    Parameters

    execute

    Closure executed n-times.

  • Creates array of items by executing supplied closure n-times. Handy for generating arrays of random values.

    Declaration

    Swift

    public func times<T>(execute: () -> T) -> [T]

    Parameters

    execute

    Closure returning some item n-times.