Skip to content

Instantly share code, notes, and snippets.

@Aldaviva
Created January 30, 2019 05:15
Show Gist options
  • Save Aldaviva/0fef1428170ce920f8becaa76d6c2d45 to your computer and use it in GitHub Desktop.
Save Aldaviva/0fef1428170ce920f8becaa76d6c2d45 to your computer and use it in GitHub Desktop.
How long does an operation take in Java?
final long start = System.nanoTime();
// operation being timed
LOGGER.trace("Operation took {} ms", (System.nanoTime() - start) / 1_000_000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment