承接 audentio/timer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

audentio/timer

最新稳定版本:0.0.1

Composer 安装命令:

composer require audentio/timer

包简介

A timer utility class

README 文档

README

Utility class for timing actions, and limiting the time actions run for.

Installation

This library should be installed through Composer:

$ composer require audentio/timer

Usage

Limiting actions on a single request to a set period of time.

You may want to limit batched actions that are performed on a single request to prevent timeouts. For example, if you'd like to limit it to 15 seconds you can do the following:

require './vendor/autoload.php';

use Audentio\Timer\Timer;

$timer = new Timer(15);

while (true) {
    // Perform some action...
    if ($timer->hasExceededLimit()) {
        break;
    }
}

Timing actions

If you want to see how long actions are running for without any sort of limit you can do the following:

require './vendor/autoload.php';

use Audentio\Timer\Timer;

$timer = new Timer();

sleep(15);

$duration = $timer->end();

echo 'Action time in milliseconds: ' . number_format($duration->getMilliseconds());

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固