FileDocCategorySizeDatePackage
Stopwatch.javaAPI DocExample2904Sun Feb 08 21:34:08 GMT 2004None

Stopwatch

public class Stopwatch extends Object
Count the seconds up from zero, until terminated.
author
Ian F. Darwin, http://www.darwinsys.com/
version
$Id: Stopwatch.java,v 1.5 2004/02/09 03:34:07 ian Exp $

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

		//+
		long t0 = System.currentTimeMillis();
		while (true) {
			long t1 = System.currentTimeMillis();
			int seconds = (int) (t1-t0)/1000;
			System.out.print("Elapsed: " + seconds + "\r");
			try {
				Thread.sleep(999);
			} catch (InterruptedException e) {
				// nothing to say
			}
		}
		//-