estimate = new ProcessEstimator( 10000, 100 );
estimate.start();
for( int i = 0; i < 10000; i++ ) {
// Print status every 1000 items
printStatus(i);
performLengthyProcess();
estimate.unitCompleted();
}
estimate.stop();
System.out.println( "Completed " + estimate.getUnits() + " in " +
Math.round( estimate.getTimeSpent() / 1000 ) + " seconds." );