daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Jan 16th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. long startTime = System.nanoTime();
  2. timeElapsed = 0;
  3. while(sc.hasNext()) //avoid end of file
  4.     do{
  5.        long currentTime = System.nanoTime();
  6.        timeElapsed = (int)  TimeUnit.MILLISECONDS.convert(startTime-currentTime,
  7.                TimeUnit.NANOSECONDS);
  8.        //sampling code goes here
  9.     }while(timeElapsed%5000!=0)
  10.     return reservoirList;
  11. } return reservoirList;
  12.    
  13. do {
  14.     //sampling which includes a count++
  15. }while(count%5000!=0)
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