Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- timeObservable.subscribe(new Observer<Long>() {
- long time = 0; // variable for demonstating how much time has passed
- @Override
- public void onSubscribe(Disposable d) {
- time = System.currentTimeMillis() / 1000;
- }
- @Override
- public void onNext(Long aLong) {
- Log.d(TAG, "onNext: " + ((System.currentTimeMillis() / 1000) - time) + " seconds have elapsed." );
- }
- @Override
- public void onError(Throwable e) {
- }
- @Override
- public void onComplete() {
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement