Returns an observable that emits indications of the amount of time lapsed between consecutive emissions of the source observable. The first emission from this new Observable indicates the amount of time lapsed between the time when the observer subscribed to the Observable and the time when the source Observable emitted its first item.
More...
Go to the source code of this file.
|
template<class... AN> |
auto | rxcpp::operators::time_interval (AN &&...an) -> operator_factory< time_interval_tag, AN... > |
| Returns an observable that emits indications of the amount of time lapsed between consecutive emissions of the source observable. The first emission from this new Observable indicates the amount of time lapsed between the time when the observer subscribed to the Observable and the time when the source Observable emitted its first item. More...
|
|
Returns an observable that emits indications of the amount of time lapsed between consecutive emissions of the source observable. The first emission from this new Observable indicates the amount of time lapsed between the time when the observer subscribed to the Observable and the time when the source Observable emitted its first item.
- Template Parameters
-
Coordination | the type of the scheduler. |
- Parameters
-
coordination | the scheduler for time intervals. |
- Returns
- Observable that emits a time_duration to indicate the amount of time lapsed between pairs of emissions.
- Sample Code
typedef rxcpp::schedulers::scheduler::clock_type::time_point::duration duration_type;
using namespace std::chrono;
.time_interval()
.take(3);
values.
[&](duration_type v) {
long long int ms = duration_cast<milliseconds>(v).
count();
printf("OnNext: @%lldms\n", ms);
},
[](std::exception_ptr ep) {
try {
std::rethrow_exception(ep);
} catch (const std::exception& ex) {
printf("OnError: %s\n", ex.what());
}
},
[]() { printf("OnCompleted\n"); });
OnNext: @0ms
OnNext: @100ms
OnNext: @100ms
OnCompleted
#define RXCPP_OPERATORS_RX_TIME_INTERVAL_HPP |