mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 09:30:10 +08:00
26 lines
561 B
PHP
26 lines
561 B
PHP
<?php
|
|
|
|
/**
|
|
* Website: https://mudew.com/
|
|
* Author: Lkeme
|
|
* License: The MIT License
|
|
* Email: Useri@live.cn
|
|
* Updated: 2022 ~ 2023
|
|
* Source: https://github.com/anhao/bv2av/
|
|
*/
|
|
|
|
namespace BiliHelper\Tool;
|
|
|
|
use BiliHelper\Core\Log;
|
|
|
|
class DumpMemory
|
|
{
|
|
public static function dd($title)
|
|
{
|
|
$unit = array('b', 'kb', 'mb', 'gb', 'tb', 'pb');
|
|
$size = memory_get_usage(true);
|
|
$memory = @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $unit[$i];
|
|
Log::warning("$title # 内存 # $memory");
|
|
}
|
|
}
|