Advertisement
lp-gamboa

nanos

Mar 4th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.18 KB | None | 0 0
  1. long startTime = System.nanoTime();
  2. functionToMeasure();
  3. long endTime = System.nanoTime();
  4. long duration = (endTime - startTime); //in nanoseconds, divide by 10^6 to get miliseconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement