SHARE
TWEET

Untitled

a guest Mar 26th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. timeObservable.subscribe(new Observer<Long>() {
  2.  
  3.     long time = 0; // variable for demonstating how much time has passed
  4.  
  5.     @Override
  6.     public void onSubscribe(Disposable d) {
  7.         time = System.currentTimeMillis() / 1000;
  8.     }
  9.     @Override
  10.     public void onNext(Long aLong) {
  11.         Log.d(TAG, "onNext: " + ((System.currentTimeMillis() / 1000) - time) + " seconds have elapsed." );
  12.     }
  13.     @Override
  14.     public void onError(Throwable e) {
  15.  
  16.     }
  17.     @Override
  18.     public void onComplete() {
  19.  
  20.     }
  21. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top