public static function progressbar( $title, $numerator, $denominator, $line, $time_id = null, $color = 'cyan' ) {
		static $timer = array();
		if( $time_id ) {
			if( !isset($timer[$time_id]) || $timer[$time_id]['last_numerator'] > $numerator ) {
				$timer[$time_id] = array( 'start' => microtime(true) );
			}
			$timer[$time_id]['last_numerator'] = $numerator;
		}

		$text      = $title . ' - ' . self::num_display($numerator) . '/' . self::num_display($denominator);
		$time_text = '';
		if( $time_id ) {
			$diff      = microtime(true) - $timer[$time_id]['start'];
			$time_left = self::formtime(($numerator ? $diff / $numerator : 0) * ($denominator - $numerator));
			$elapsed   = self::formtime($diff);
			if( $diff > 2 ) {
				$time_text = $time_left . " ($elapsed)";
			}
		}
		$width   = max(min(Misc::cols() - strlen($text) - (strlen($time_text) ? : -1) - 6, $denominator), 4);
		$main_xs = floor(($numerator / $denominator) * $width);

		$str = $text . ' [' . Style::$color(str_repeat('#', $main_xs)) . str_repeat('.', $width - $main_xs) . "] " . $time_text;

		Output::line($str, $line);
	}
public static function progressbar( $title, $numerator, $denominator, $line, $time_id = null, $color = 'cyan' ) {
		static $timer = array();
		if( $time_id ) {
			if( !isset($timer[$time_id]) || $timer[$time_id]['last_numerator'] > $numerator ) {
				$timer[$time_id] = array( 'start' => microtime(true) );
			}
			$timer[$time_id]['last_numerator'] = $numerator;
		}

		$text      = $title . ' - ' . self::num_display($numerator) . '/' . self::num_display($denominator);
		$time_text = '';
		if( $time_id ) {
			$diff      = microtime(true) - $timer[$time_id]['start'];
			$time_left = self::formtime(($numerator ? $diff / $numerator : 0) * ($denominator - $numerator));
			$elapsed   = self::formtime($diff);
			if( $diff > 2 ) {
				$time_text = $time_left . " ($elapsed)";
			}
		}
		$width   = max(min(Misc::cols() - strlen($text) - (strlen($time_text) ? : -1) - 6, $denominator), 4);
		$main_xs = floor(($numerator / $denominator) * $width);

		$str = $text . ' [' . Style::$color(str_repeat('#', $main_xs)) . str_repeat('.', $width - $main_xs) . "] " . $time_text;

		Output::line($str, $line);
	}
public static function progressbar ( $ title , $ numerator , $ denominator , $ line , $ time_id = null , $ color = 'cyan' ) { static $ timer = array ( ) ; if ( $ time_id ) { if ( ! isset ( $ timer [ $ time_id ] ) || $ timer [ $ time_id ] [ 'last_numerator' ] > $ numerator ) { $ timer [ $ time_id ] = array ( 'start' => microtime ( true ) ) ; } $ timer [ $ time_id ] [ 'last_numerator' ] = $ numerator ; } $ text = $ title . ' - ' . self :: num_display ( $ numerator ) . '/' . self :: num_display ( $ denominator ) ; $ time_text = '' ; if ( $ time_id ) { $ diff = microtime ( true ) - $ timer [ $ time_id ] [ 'start' ] ; $ time_left = self :: formtime ( ( $ numerator ? $ diff / $ numerator : 0 ) * ( $ denominator - $ numerator ) ) ; $ elapsed = self :: formtime ( $ diff ) ; if ( $ diff > 2 ) { $ time_text = $ time_left . " ($elapsed)" ; } } $ width = max ( min ( Misc :: cols ( ) - strlen ( $ text ) - ( strlen ( $ time_text ) ? : - 1 ) - 6 , $ denominator ) , 4 ) ; $ main_xs = floor ( ( $ numerator / $ denominator ) * $ width ) ; $ str = $ text . ' [' . Style :: $ color ( str_repeat ( '#' , $ main_xs ) ) . str_repeat ( '.' , $ width - $ main_xs ) . "] " . $ time_text ; Output :: line ( $ str , $ line ) ; }
Draw a Progress Bar

@staticvar array $timer
@param string   $title
@param int      $numerator
@param int      $denominator
@param int      $line Which row of the terminal to render
@param int|null $time_id
@param string   $color
Draw a Progress Bar