1 #include "rxcpp/rx.hpp" 2 3 #include "rxcpp/rx-test.hpp" 4 #include "catch.hpp" 5 6 SCENARIO("sample period sample") { 7 printf("//! [sample period sample]\n"); 8 auto values = rxcpp::observable<>::interval(std::chrono::milliseconds(2)). 9 take(7). 10 sample_with_time(std::chrono::milliseconds(4)); 11 values. 12 subscribe( __anon51a7d30a0102(long v) 13 [](long v) { 14 printf("OnNext: %ld\n", v); 15 }, __anon51a7d30a0202() 16 []() { printf("OnCompleted\n"); }); 17 printf("//! [sample period sample]\n"); 18 } 19