Skip to content

tkachikov/memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

memory

Memory release: 1.2 License: MIT

This package need to convert bytes to view. Exmaple: 4194304 => 4 MB

Installation

composer require tkachikov/memory

Usage

// Create class
$memory = new Memory();

// Example memory usage: 2 MB
$usage = $memory->showUsage();

// Exmaple memory peak: 4 MB
$peak = $memory->showPeak();

// Get custom view memory
$customMemory = (new Memory()) // or in Laravel app(Memory::class)
  ->size(memory_get_usage(true))
  ->show();

// Reset peak memory (work on php 8.2)
$memory->reset();

License

This package is open-sourced software licensed under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages