// File: TestTime.java (Module 8) // // Author: Rahul Simha // Created: October 6, 1998 // // Illustrates use of timing. public class TestTime { public static void main (String[] argv) { long start = System.currentTimeMillis (); for (int i=1; i<=100000; i++) { int j = i*i; } long stop = System.currentTimeMillis (); System.out.println ("Time taken: " + (stop-start)); } }