Skip to content

Instantly share code, notes, and snippets.

@purplefox
Created May 29, 2015 14:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save purplefox/2078ed8f1367b67f52a3 to your computer and use it in GitHub Desktop.
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