bedd/timer

PHP timer

1.0.0 2017-03-06 20:28 UTC

This package is not auto-updated.

Last update: 2024-04-28 00:48:14 UTC


README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Scrutinizer Code Quality

Installation

The best way to install this library is to use composer.

{
    "require": {
        "bedd/timer": "1.*"
    }
}

Usage

$t = new Bedd\Timer\Timer();
$t->start();

// your process
sleep(3);

$t->end();
print_r($t->getSummary());

Output

Array
(
    [status] => 3
    [start] => 1488831973.2328
    [end] => 1488831976.2334
    [total] => 3.0005979537964
    [paused] => 0
    [laps] => Array
        (
            [0] => Array
                (
                    [name] => start
                    [start] => 1488831973.2328
                    [end] => 1488831976.2334
                    [total] => 3.0006039142609
                )
        )
)

License

This library is available under the MIT license.