2017 © Pedro Peláez
 

library memoryusage

a basic php lclass to track memory usage

image

kanel/memoryusage

a basic php lclass to track memory usage

  • Thursday, September 28, 2017
  • by elkaadka
  • Repository
  • 0 Watchers
  • 0 Stars
  • 28 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

build, (*1)

A simple Memory usage tracking class to benchmark functions or code execution memory consumption, (*2)

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), (*3)

       $memoryUsage = MemoryBench::lap();
    

    Where $memoryUsage is instance of class :, (*4)

    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

The Versions

28/09 2017

dev-master

9999999-dev

a basic php lclass to track memory usage

  Sources   Download

The Requires

  • php >=7.0

 

The Development Requires

by Adil El Kanabi

28/09 2017

2.0.1

2.0.1.0

a basic php lclass to track memory usage

  Sources   Download

The Requires

  • php >=7.0

 

The Development Requires

by Adil El Kanabi

28/09 2017

2.0.0

2.0.0.0

a basic php lclass to track memory usage

  Sources   Download

The Requires

  • php >=7.0

 

The Development Requires

by Adil El Kanabi

02/04 2017

1.0.0

1.0.0.0

a basic php lclass to track memory usage

  Sources   Download

The Requires

  • php >=7.0

 

The Development Requires

by Adil El Kanabi