Guest User

Untitled

a guest
Jan 16th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  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)
Add Comment
Please, Sign In to add comment