Download the PHP package macroman/terminal-progress-bar without Composer
On this page you can find all versions of the php package macroman/terminal-progress-bar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download macroman/terminal-progress-bar
More information about macroman/terminal-progress-bar
Files in macroman/terminal-progress-bar
Package terminal-progress-bar
Short Description Flexible ascii progress bar.
License GPL-3.0-or-later
Homepage https://github.com/MacroMan/PHPTerminalProgressBar
Informations about the package terminal-progress-bar
Flexible ascii progress bar.
Installation
Usage
First we create a Bar, giving it a format string
as well as the total, telling the progress bar when it will
be considered complete. Then call tick() when needed.
You can also use update(amount) to set the current tick value instead of ticking each time there is an increment:
Options
These are properties in the object you can read/set:
symbolCompleteCompletion character defaulting to "="symbolIncompleteIncomplete character defaulting to " "throttleMinimum time between updates in seconds defaulting to 0.016currentCurrent ticktotalSame value passed in when initialisingsecondPrecisionNumber of decimal digits to use in "seconds" unitspercentPrecisionNumber of decimal digits to use in "percentage" unitspercent(read only) Current percentage completioneta(read only) Estimate seconds until completionrate(read only) Number of ticks per secondelapsed(read only) Seconds since initialisation
Tokens
These are tokens you can use in the format of your progress bar.
:barthe progress bar itself:currentcurrent tick number:totaltotal ticks:elapsedtime elapsed in seconds:percentcompletion percentage:etaestimated completion time in seconds:raterate of ticks per second
Format example
Interrupt example
To display a message during progress bar execution, use interrupt()
Symbols/Precision example
To change the symbols or precision used on the progress bar
Throttle example
The draw interval is throttled at once per 100ms for performance. You can change this value if desired, eg lower for a smoother animation or higher if your work is resource intensive.
License
See LICENSE