Interface Timed<T>

All Superinterfaces:
Supplier<T>

public interface Timed<T> extends Supplier<T>
Author:
Simon Baslé
  • Method Details

    • get

      T get()
      Get the value wrapped by this Timed.
      Specified by:
      get in interface Supplier<T>
      Returns:
      the onNext value that was timed
    • elapsed

      Duration elapsed()
      Get the elapsed Duration since the previous onNext (or onSubscribe in case this represents the first onNext). If possible, nanosecond resolution is used.
      Returns:
      the elapsed Duration since the previous onNext
    • elapsedSinceSubscription

      Duration elapsedSinceSubscription()
      Get the elapsed Duration since the subscription (onSubscribe signal). If possible, nanosecond resolution is used.
      Returns:
      the elapsed Duration since subscription
    • timestamp

      Instant timestamp()
      Get the timestamp of the emission of this timed onNext, as an Instant. It has the same resolution as Instant.ofEpochMilli(long).
      Returns:
      the epoch timestamp Instant for this timed onNext