@@ -2871,6 +2871,35 @@ trait Observable[+T]
2871
2871
toScalaObservable[java.lang.Boolean ](rx.Observable .sequenceEqual[U ](thisJava, thatJava, equalityJava)).map(_.booleanValue)
2872
2872
}
2873
2873
2874
+ /**
2875
+ * Returns an Observable that emits records of the time interval between consecutive items emitted by the
2876
+ * source Obsegrvable.
2877
+ * <p>
2878
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/timeInterval.png">
2879
+ *
2880
+ * @return an Observable that emits time interval information items
2881
+ */
2882
+ def timeInterval : Observable [(Duration , T )] = {
2883
+ import scala .concurrent .duration .DurationLong
2884
+ toScalaObservable(asJavaObservable.timeInterval())
2885
+ .map(inv => (inv.getIntervalInMilliseconds millis, inv.getValue))
2886
+ }
2887
+
2888
+ /**
2889
+ * Returns an Observable that emits records of the time interval between consecutive items emitted by the
2890
+ * source Observable, where this interval is computed on a specified Scheduler.
2891
+ * <p>
2892
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/timeInterval.s.png">
2893
+ *
2894
+ * @param scheduler the [[Scheduler ]] used to compute time intervals
2895
+ * @return an Observable that emits time interval information items
2896
+ */
2897
+ def timeInterval (scheduler : Scheduler ): Observable [(Duration , T )] = {
2898
+ import scala .concurrent .duration .DurationLong
2899
+ toScalaObservable(asJavaObservable.timeInterval(scheduler.asJavaScheduler))
2900
+ .map(inv => (inv.getIntervalInMilliseconds millis, inv.getValue))
2901
+ }
2902
+
2874
2903
/**
2875
2904
* Lift a function to the current Observable and return a new Observable that when subscribed to will pass
2876
2905
* the values of the current Observable through the function.
0 commit comments