Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long startTime = System.nanoTime();
- functionToMeasure();
- long endTime = System.nanoTime();
- long duration = (endTime - startTime); //in nanoseconds, divide by 10^6 to get miliseconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement