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
ublic static void main(String[] args) { | |
while (true) { | |
new ScratchPad().perf(); | |
} | |
} | |
public void perf() { | |
try { | |
long numIts = 100000; | |
long start = System.currentTimeMillis(); | |
long cnt = 0; | |
for (long l = 0; l < numIts; l++) { | |
// Do whatever it you want to do. | |
} | |
long end = System.currentTimeMillis(); | |
double rate = 1000 * (double) numIts / (end - start); | |
System.out.println("Rate: " + rate + " cnt: " + cnt); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment