kanel/memoryusage
Composer 安装命令:
composer require kanel/memoryusage
包简介
a basic php lclass to track memory usage
README 文档
README
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)
Where $memoryUsage is instance of class :$memoryUsage = MemoryBench::lap();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
Where $memoryUsages is an array of MemoryUsage classes$memoryUsages = MemoryBench::getHistory();
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2017-04-01