FileDocCategorySizeDatePackage
Timer0.javaAPI DocExample632Sun Feb 08 21:33:46 GMT 2004None

Timer0

public class Timer0 extends Object
How quickly can you press return?
author
Ian Darwin, http://www.darwinsys.com/
version
$Id: Timer0.java,v 1.4 2004/02/09 03:33:46 ian Exp $

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		//+
		long t0, t1;
		System.out.println("Press return when ready");
		t0=System.currentTimeMillis();
		int b;
		do {
			b = System.in.read();
		} while (b!='\r" && b != '\n");
		t1=System.currentTimeMillis();
		double deltaT = t1-t0;
		System.out.println("You took " + 
			DecimalFormat.getInstance().format(deltaT/1000.) + " seconds.");
		//-