Skip to content

Instantly share code, notes, and snippets.

@jonjack
Last active October 16, 2019 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonjack/310e513788a95e53dd37d723fdf8b68f to your computer and use it in GitHub Desktop.
Save jonjack/310e513788a95e53dd37d723fdf8b68f to your computer and use it in GitHub Desktop.
import org.joda.time.LocalTime;
public class Timer {
public static void main(String[] args) {
LocalTime start = LocalTime.now();
// some event to be timed
LocalTime end = LocalTime.now();
int delta = end.getMillisOfDay() - start.getMillisOfDay();
System.out.println("Time took: " + Double.valueOf(delta)/1000 + " seconds");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment