jopmesman/logtimer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jopmesman/logtimer

Composer 安装命令:

composer require jopmesman/logtimer

包简介

Simple time logger.

README 文档

README

This very simple package can be used to time processes in php.

Installation

composer require jopmesman/logtimer

To use the timer

Before a process youwish to time.

LogTimer::time('Any text');

After the process you wish to time, add the same line.

LogTimer::time('Any text');

At this moment the time between those 2 lines is timed. At the end of the complete script you could get all items you timed.

print_r(LogTimer::times());

This gives the following result:

Array 
(
  "Any text" => 2.0019979476929
)

Here is complete example:

LogTimer::time('Complete process');
LogTimer::time('Get all rows from the database');
$data = getAllDataFromDB();
LogTimer::time('Get all rows from the database');
//Loop over all the rows from the database
LogTimer::time('Looping');
$return = [];
foreach ($data as $row) {
    $return[$row['id']] = $row['name'];
}
LogTimer::time('Looping');
LogTimer::time('Complete process');

print_r(LogTimer::times());

The result of the print_r could someting like

Array
(
    [Get all rows from the database] => 1.0011401176453
    [Looping] => 2.0006589889526
    [Complete process] => 3.0018129348755
)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-08-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固