timeInterval method

Stream<TimeInterval<T>> timeInterval()

Records the time interval between consecutive values in a Stream sequence.

Example

Stream.fromIterable([1])
  .interval(Duration(seconds: 1))
  .timeInterval()
  .listen(print); // prints TimeInterval{interval: 0:00:01, value: 1}

Implementation

Stream<TimeInterval<T>> timeInterval() =>
    TimeIntervalStreamTransformer<T>().bind(this);