Last active
April 9, 2018 07:11
-
-
Save solairerove/80e203c29b821e22f24132fc38125fab to your computer and use it in GitHub Desktop.
benchmark lol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final long start = System.currentTimeMillis(); | |
// some process | |
final long end = System.currentTimeMillis(); | |
final long result = end - start; | |
final String format = String.format("%02d min, %02d sec", | |
TimeUnit.MILLISECONDS.toMinutes(result), | |
TimeUnit.MILLISECONDS.toSeconds(result) - | |
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(result))); | |
System.out.println("Process time is " + format); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment