Created
August 1, 2018 07:38
-
-
Save akarnokd/c187983b43a795e9777ac58189b8bc24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.TimeUnit; | |
import org.junit.Test; | |
import io.reactivex.Observable; | |
public class SampleTest { | |
@Test | |
public void test() throws Exception { | |
Observable.interval(50, TimeUnit.MILLISECONDS) | |
.doOnNext(v -> { | |
if (v % 20 == 0) { | |
System.out.println("--------- second: " + v / 20); | |
} | |
}) | |
.sample(200, TimeUnit.MILLISECONDS) | |
.subscribe(System.out::println); | |
Thread.sleep(5000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment