// A program from Chapter 8 of Sams Teach Yourself Java in 24 Hours // by Rogers Cadenhead, http://www.java24hours.com/ package com.java24hours; class Benchmark2 { public static void main(String[] arguments) { long startTime = System.currentTimeMillis(); long endTime = startTime + 60000; long index = 0; while (true) { double x = 17 * 76; long now = System.currentTimeMillis(); if (now > endTime) { break; } index++; } System.out.println(index + " loops in one minute."); } }