public long getTimeRemainingInMillis ( ) { long batchTime = System . currentTimeMillis ( ) - startTime ; double timePerIteration = ( double ) batchTime / ( double ) worked . get ( ) ; return ( long ) ( timePerIteration * ( total - worked . get ( ) ) ) ; }
Gets the estimated time remaining in milliseconds based upon the total number of work units the start time and how many units have been done so far .