定制 kkiernan/php-stopwatch 二次开发

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

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

kkiernan/php-stopwatch

Composer 安装命令:

composer require kkiernan/php-stopwatch

包简介

A simple stopwatch in PHP

README 文档

README

A simple stopwatch in PHP.

StyleCI

Contents

Installation

Install the package using composer.

composer require kkiernan/php-stopwatch

Available Methods

  • start()
  • stop()
  • lap()
  • elapsed()

Basic Usage

use Kiernan\Stopwatch;

require dirname(__DIR__). '/vendor/autoload.php';

$stopwatch = new Stopwatch();

$stopwatch->start();

usleep(1500000);

$stopwatch->stop();

echo "Script executed in {$stopwatch->elapsed()} seconds";

The above example prints the following output:

Script executed in 3.0002250671387 seconds

Laps

use Kiernan\Stopwatch;

require dirname(__DIR__). '/vendor/autoload.php';

$stopwatch = new Stopwatch();

$stopwatch->start();
sleep(1);
$stopwatch->lap();
sleep(2);
$stopwatch->lap();
sleep(1);
$stopwatch->lap();
$stopwatch->stop();

print_r($stopwatch->laps);

The above example prints the following output:

Array
(
    [0] => Kiernan\Lap Object
        (
            [start:protected] => 1542305179.9815
            [duration:protected] => 1.0043249130249
            [name:protected] =>
        )

    [1] => Kiernan\Lap Object
        (
            [start:protected] => 1542305181.9823
            [duration:protected] => 2.0006990432739
            [name:protected] =>
        )

    [2] => Kiernan\Lap Object
        (
            [start:protected] => 1542305182.9823
            [duration:protected] => 1.0000500679016
            [name:protected] =>
        )

)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固