FileDocCategorySizeDatePackage
PrintMillis.javaAPI DocGlassfish v2 API2917Fri May 04 22:31:06 BST 2007com.sun.appserv.management.util.misc

PrintMillis

public class PrintMillis extends Object
Useful for printing elapsed timings out. Example: final PrintMillis timer = new PrintMillis(); ... timer.println( "start" ); ... timer.println( "middle" ); ... ... timer.println( "end" );

Fields Summary
private long
mLast
Constructors Summary
public PrintMillis()

	
		
	
	
		mLast	= System.currentTimeMillis();
	
Methods Summary
public voidprintln(java.lang.String msg)
Print out the milliseconds that have elapsed since the last call.

		final long	elapsed	= System.currentTimeMillis() - mLast;
		
		// this printing to System.out is BY DESIGN, so leave it.
		System.out.println( (msg == null ? "" : msg) + ": " + elapsed );
		
		mLast	= System.currentTimeMillis();