Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.