TimeMonitor

public protocol TimeMonitor

Undocumented

  • Adds a periodic observer.

    Declaration

    Swift

    func addPeriodicObserver(interval: TimeInterval, observeOn dispatchQueue: DispatchQueue?, using eventHandler: @escaping (TimeInterval) -> Void) -> UUID

    Parameters

    interval

    The interval to invoke the handler.

    dispatchQueue

    The dispatch queue to observe the events on.

    eventHandler

    The handler to invoke on when the time comes.

    Return Value

    A uuid token to represent the observation, used to later remove a single observation.

  • Adds a boundary observer.

    Declaration

    Swift

    func addBoundaryObserver(times: [TimeInterval], observeOn dispatchQueue: DispatchQueue?, using eventHandler: @escaping (TimeInterval, Double) -> Void) -> UUID

    Parameters

    times

    The times to use the event handler.

    dispatchQueue

    The dispatch queue to observe the events on.

    eventHandler

    The handler to invoke on when the time comes.

    Return Value

    A uuid token to represent the observation, used to later remove a single observation.

  • removes a single periodic observer using the uuid provided when added the observation.

    Declaration

    Swift

    func removePeriodicObserver(_ token: UUID)
  • removes a single boundary observer using the uuid provided when added the observation.

    Declaration

    Swift

    func removeBoundaryObserver(_ token: UUID)
  • Removes all the periodic observers.

    Declaration

    Swift

    func removePeriodicObservers()
  • Removes all the boundary observers.

    Declaration

    Swift

    func removeBoundaryObservers()