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.
61 lines
2.0 KiB
Markdown
61 lines
2.0 KiB
Markdown
# PHPExecutionTimer
|
|
__Utility class for execution time measurement__
|
|
|
|

|
|

|
|

|
|
|
|
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 (-h / --help) and version (--version) 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('Checker', 'File checker', 'php checker.php');)
|
|
|
|
[comment]: <> ($cmdline->addDefaultArguments();)
|
|
|
|
[comment]: <> ($cmdline->addOption(new Flag('enhanced', false, 'Deep check ?'));)
|
|
|
|
[comment]: <> ($cmdline->addValue(new Value('path', 'File path', new StringParser()));)
|
|
|
|
[comment]: <> (var_dump($args = $cmdline->parse());)
|
|
|
|
[comment]: <> ($cmdline->treatDefaultArguments($args);)
|
|
|
|
[comment]: <> (```)
|
|
|
|
[comment]: <> (Would display something like that : )
|
|
|
|
[comment]: <> ( class stdClass#13 (1) {)
|
|
|
|
[comment]: <> ( public $enhanced => bool(false))
|
|
|
|
[comment]: <> ( public $path => string("my/path/to/a/file"))
|
|
|
|
[comment]: <> ( })
|