Skip to content

Instantly share code, notes, and snippets.

@maniksurtani
Created May 7, 2013 09:47
Show Gist options
  • Save maniksurtani/5531494 to your computer and use it in GitHub Desktop.
Save maniksurtani/5531494 to your computer and use it in GitHub Desktop.
Better code
boolean debug = log.isDebugEnabled();
long start = debug ? System.nanoTime() : -1;
// do some work
if (debug)
log.debug("Duration(ms)..." + ((System.nanoTime() - start)/1000000000) + "\n"+ "\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment