Why is it taking so long until rx.interval creates any output?

310 Views Asked by At

I wanted to create an observable that emits an event at an interval of 100 ms.

I tried using rx.interval:

import rx
tick = rx.interval(100)
tick.subscribe(on_next=lambda i: print(i))

The process is not running and gives the disposable as output:

<rx.disposable.disposable.Disposable object at 0x7f7eac712dd8>

How can I get this done?

1

There are 1 best solutions below

0
Aravind OR On

Interval is in seconds. So this works fine:

rx.interval(0.1).subscribe(on_next=lambda i: print(i))