tinyapps/script-progress

Super simple library for live-updating php-cli script progress output with estimated time that is left.

v1.0.1 2021-12-16 12:31 UTC

This package is auto-updated.

Last update: 2024-09-16 18:30:08 UTC


README

This is a super simple library for php-cli script progress output. It’s easy-to-use and can print the estimated time that is left until your script is done. You always know if your script is still doing something or might be stuck – and when it will approximately finish.

Example output: 20% done. Appr. 02m 16s remaining. – That’s it.

Installation

composer require tinyapps/script-progress

Example Usage

$numberOfItems = 20;
$progress = new TinyApps\ScriptProgress\Progress($numberOfItems);

for ($i=0; $i <= $numberOfItems; $i++) {
    // do something
    $progress->update($i);
}

There is also an example in the corresponding folder.

More features will be added soon.