init(millisecondsDelay:isRepeating:callback:)

Creates a new timer instance that calls setInterval or setTimeout JavaScript functions for you under the hood.

JSTimer.swift:61
init(millisecondsDelay: Double, isRepeating: Bool = false, callback: @escaping () -> ())
  • millisecondsDelay: the amount of milliseconds before the callback closure is executed.

  • isRepeating: when true the callback closure is executed repeatedly at given millisecondsDelay intervals indefinitely until the timer is deallocated.

  • callback: the closure to be executed after a given millisecondsDelay interval.