Skip to Content
Hands-On Reactive Programming with Python
book

Hands-On Reactive Programming with Python

by Romain Picard
October 2018
Intermediate to advanced
420 pages
10h 26m
English
Packt Publishing
Content preview from Hands-On Reactive Programming with Python

The time_interval operator

The time_interval operator measures the time that has elapsed between two emissions of items. The following figure shows the marble diagram for this operator:

Figure 9.21: The time_interval operator

The prototype of this operator is the following:

Observable.time_interval(self, scheduler=None)

Here, scheduler is the scheduler to use to measure the interval. If no scheduler is provided, then the timeout scheduler is used. The time_interval operator emits items of type TimeInterval. They contain two properties:

  • value, which contains the value of the source item
  • interval, which contains a datetime.timedelta object ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Programming with Design Patterns

Python Programming with Design Patterns

James W. Cooper

Publisher Resources

ISBN: 9781789138726Supplemental Content