2017 © Pedro Peláez
 

library time-chronograph

travail/time-chronograph

image

travail/time-chronograph

travail/time-chronograph

  • Thursday, May 1, 2014
  • by travail
  • Repository
  • 1 Watchers
  • 1 Stars
  • 40,874 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

\Time\Chronograph

NAME

\Time\Chronograph -, (*1)

SYNOPSIS


use \Time\Chronograph; require_once '/path/to/vendor/autoload.php'; $chrono = new Chronograph(); $chrono->start(); $chrono->mark('before_do_something'); /* Do something */ $chrono->mark('after_do_something'); $chrono->stop(); $diff = $chrono->diff('before_do_something', 'after_do_something'); echo sprintf("Took %.3f to do something", $diff); $total = $chrono->total(); echo sprintf("Took %.3f seconds\n", $total); $total_in_micro_seconds = $chrono->total(6); echo sprintf("Took %.6f seconds\n", $total_in_micro_seconds);

INSTALLATION

To install this package into your project via composer, add the following snippet to your composer.json. Then run composer install., (*2)

"require": {
    "travail/time-chronograph": "dev-master"
}

If you want to install from gihub, add the following:, (*3)

"repositories": [
    {
        "type": "vcs",
        "url": "git@github.com:travail/php-Time-Chronograph.git"
    }
]

METHODS

mark

Description

float mark(string $mark), (*4)

Returns the result of gettimeofday., (*5)

Parameters

  • $mark

start

Description

void start(void), (*6)

stop

Description

void stop(void), (*7)

total

Description

float total([int $digit = 3]), (*8)

Returns the time between the mark $start and $end in given decimal place, 3 (millisecond) by default., (*9)

Parameters

  • $digit

diff

Description

float diff(string $start, strig $end [, int $digit = 3]), (*10)

Returns the time between the mark $start and $end in given decimal place, millisecond by default., (*11)

Parameters

  • $start
  • $end
  • $digit

AUTHOR

travail, (*12)

LICENSE

This library is free software. You can redistribute it and/or modify it under the same terms as PHP itself., (*13)

The Versions

01/05 2014

dev-master

9999999-dev

travail/time-chronograph

  Sources   Download

PHP-3.0

01/05 2014

dev-develop

dev-develop

travail/time-chronograph

  Sources   Download

PHP-3.0

01/05 2014

v0.1.0

0.1.0.0

travail/time-chronograph

  Sources   Download

PHP-3.0