Skip to content

Instantly share code, notes, and snippets.

@sssionggg
Created September 19, 2010 06:46
Show Gist options
  • Select an option

  • Save sssionggg/586492 to your computer and use it in GitHub Desktop.

Select an option

Save sssionggg/586492 to your computer and use it in GitHub Desktop.
long t1 = System.currentTimeMillis();
task.run(); // task is a Runnable which encapsulates the unit of work
long t2 = System.currentTimeMillis();
System.out.println("My task took " + (t2 - t1) + " milliseconds to execute.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment