public class MeasureTime extends Object
{
  public static void main(String[] args) {
    long startTime, endTime;
    startTime = System.currentTimeMillis();
    // operation subject to measurement put here >> 
		operation();
    // <<
    endTime = System.currentTimeMillis();
    Out.println(String.format("Duration: %d", endTime - startTime));
  }
	static void operation() {
    try {
      Thread.sleep(1000);
    } catch(InterruptedException ex) {
			Out.println("Interrupted");
		}
	}
}

