定制 travail/time-chronograph 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

travail/time-chronograph

Composer 安装命令:

composer require travail/time-chronograph

包简介

travail/time-chronograph

README 文档

README

NAME

\Time\Chronograph -

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.

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

If you want to install from gihub, add the following:

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

METHODS

mark

Description

float mark(string $mark)

Returns the result of gettimeofday.

Parameters

  • $mark

start

Description

void start(void)

stop

Description

void stop(void)

total

Description

float total([int $digit = 3])

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

Parameters

  • $digit

diff

Description

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

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

Parameters

  • $start
  • $end
  • $digit

AUTHOR

travail

LICENSE

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

统计信息

  • 总下载量: 180.71k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: PHP-3.0
  • 更新时间: 2014-04-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固