Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long startTime = System.nanoTime();
- timeElapsed = 0;
- while(sc.hasNext()) //avoid end of file
- do{
- long currentTime = System.nanoTime();
- timeElapsed = (int) TimeUnit.MILLISECONDS.convert(startTime-currentTime,
- TimeUnit.NANOSECONDS);
- //sampling code goes here
- }while(timeElapsed%5000!=0)
- return reservoirList;
- } return reservoirList;
- do {
- //sampling which includes a count++
- }while(count%5000!=0)
Add Comment
Please, Sign In to add comment