You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
phpexecutiontimer/README.md

61 lines
2.0 KiB
Markdown

# PHPExecutionTimer
__Utility class for execution time measurement__
![last release](https://badgen.net/packagist/v/darkelfe14728/executiontimer?label=Last%20release)
![licence](https://badgen.net/packagist/license/darkelfe14728/executiontimer?color=red)
![nb releases](https://badgen.net/packagist/dt/darkelfe14728/executiontimer?color=green)
A utility class to measure and display execution time.
Include step time measurement.
## Installation
```
composer require darkelfe14728/executiontimer
```
[comment]: <> (## Description)
[comment]: <> (At first, create a new CommandLine with program name and description. Add options and values by using respectively _addOption_ and _addValue_.)
[comment]: <> (Default options for help &#40;-h / --help&#41; and version &#40;--version&#41; can be add with _addDefaultArguments_ and use _treatDefaultArguments_ for launching associated treatments.)
[comment]: <> (Treat script arguments with _parse_ : return an object of variables.)
[comment]: <> (## Example )
[comment]: <> (```php)
[comment]: <> (<?php)
[comment]: <> (use CommandLine\CommandLine;)
[comment]: <> (use CommandLine\Argument\Option\Flag;)
[comment]: <> (use CommandLine\Argument\Parser\StringParser;)
[comment]: <> (use CommandLine\Argument\Value\Value;)
[comment]: <> ($cmdline = new CommandLine&#40;'Checker', 'File checker', 'php checker.php'&#41;;)
[comment]: <> ($cmdline->addDefaultArguments&#40;&#41;;)
[comment]: <> ($cmdline->addOption&#40;new Flag&#40;'enhanced', false, 'Deep check ?'&#41;&#41;;)
[comment]: <> ($cmdline->addValue&#40;new Value&#40;'path', 'File path', new StringParser&#40;&#41;&#41;&#41;;)
[comment]: <> (var_dump&#40;$args = $cmdline->parse&#40;&#41;&#41;;)
[comment]: <> ($cmdline->treatDefaultArguments&#40;$args&#41;;)
[comment]: <> (```)
[comment]: <> (Would display something like that : )
[comment]: <> ( class stdClass#13 &#40;1&#41; {)
[comment]: <> ( public $enhanced => bool&#40;false&#41;)
[comment]: <> ( public $path => string&#40;"my/path/to/a/file"&#41;)
[comment]: <> ( })