定制 kanel/memoryusage 二次开发

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

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

kanel/memoryusage

Composer 安装命令:

composer require kanel/memoryusage

包简介

a basic php lclass to track memory usage

README 文档

README

build

A simple Memory usage tracking class to benchmark functions or code execution memory consumption

#How it works :

  • Start the memory tracking
        MemoryUsage::start();     
    
  • Mark a place as a lap (the memory tracking will continue counting after returning the difference between the start and this lap)
        $memoryUsage = MemoryBench::lap();
    
    Where $memoryUsage is instance of class :
    class MemoryUsage
    {
            protected $memory;
            protected $realMemory;
            protected $memoryPeak;
            protected $realMemoryPeak;
    }
    
    
  • If you want the memory used between this lap and the last one, send the following constant as a parameter:
        $memoryUsage = MemoryBench::lap(MemoryBench::FROM_LAST_LAP);
    
  • To stop the memory usage tracking and get the memory used from the beginning (the start)
        $memoryUsage = MemoryBench::stop();
    
  • To stop the memory tracking and get the memory used from the last lap
        $memoryUsage = MemoryBench::stop(MemoryBench::FROM_LAST_LAP);
    
  • To get the history of tracked memory
        $memoryUsages = MemoryBench::getHistory();
    
    Where $memoryUsages is an array of MemoryUsage classes

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固