Java tutorial
public class MainClass { public static void main(String[] a) { long start = System.currentTimeMillis(); // block of code to time long end = System.currentTimeMillis(); System.out.println("It took " + (end - start) + " milliseconds"); } }