#include <rpp/rpp.hpp>
#include <chrono>
#include <iostream>
int main()
{
[start = rpp::schedulers::clock_type::now()](size_t v) { std::cout << "emit " << v << " duration since start " << std::chrono::duration_cast<std::chrono::milliseconds>(rpp::schedulers::clock_type::now() - start).count() << "ms\n"; },
[]() { std::cout << "On complete\n"; });
[start = rpp::schedulers::clock_type::now()](size_t v) { std::cout << "emit " << v << " duration since start " << std::chrono::duration_cast<std::chrono::milliseconds>(rpp::schedulers::clock_type::now() - start).count() << "ms\n"; },
[]() { std::cout << "On complete\n"; });
}
auto interval(rpp::schedulers::duration initial, rpp::schedulers::duration period, TScheduler &&scheduler)
Creates rpp::observable that emits a sequential integer every specified time interval,...
Definition interval.hpp:72
auto take(size_t count)
Emit only first count items provided by observable, then send on_completed
Definition take.hpp:92
auto subscribe(observer< Type, ObserverStrategy > &&observer)
Subscribes passed observer to emissions from this observable.
Definition subscribe.hpp:226
Definition functors.hpp:54