Do you know how to subscribe for condition state that stay for x time?

For example if I have `BehaviorSubject<int>` that represent int value between 0 - 100, and this value is changing over time, I want to subscribe when this value is under 50 for 10 seconds continuously.

if the value change back to above 50 for a moment and then down 50 again, I want to count again for 10 seconds. How can I do this?

Many thanks!