src/Timer.php
public function stop($key)
    {
        $benchmark = $this->get($key);

        $benchmark['stop_time'] = microtime(true);
        $benchmark['avg_time']  = $benchmark['stop_time'] - $benchmark['start_time'];
        $benchmark['stop_memory']   = memory_get_usage(true);
        $benchmark['avg_memory']    = ( ($benchmark['stop_memory'] - $benchmark['start_memory']) / 1024 ) / 1024;
        $benchmark['peak_memory']   = memory_get_peak_usage(true) / 1024 / 1024;
        $benchmark['running']       = false;

        $this->benchmarks[$key] = $benchmark;
    }
public function stop($key)
    {
        $benchmark = $this->get($key);

        $benchmark['stop_time'] = microtime(true);
        $benchmark['avg_time']  = $benchmark['stop_time'] - $benchmark['start_time'];
        $benchmark['stop_memory']   = memory_get_usage(true);
        $benchmark['avg_memory']    = ( ($benchmark['stop_memory'] - $benchmark['start_memory']) / 1024 ) / 1024;
        $benchmark['peak_memory']   = memory_get_peak_usage(true) / 1024 / 1024;
        $benchmark['running']       = false;

        $this->benchmarks[$key] = $benchmark;
    }
public function stop ( $ key ) { $ benchmark = $ this -> get ( $ key ) ; $ benchmark [ 'stop_time' ] = microtime ( true ) ; $ benchmark [ 'avg_time' ] = $ benchmark [ 'stop_time' ] - $ benchmark [ 'start_time' ] ; $ benchmark [ 'stop_memory' ] = memory_get_usage ( true ) ; $ benchmark [ 'avg_memory' ] = ( ( $ benchmark [ 'stop_memory' ] - $ benchmark [ 'start_memory' ] ) / 1024 ) / 1024 ; $ benchmark [ 'peak_memory' ] = memory_get_peak_usage ( true ) / 1024 / 1024 ; $ benchmark [ 'running' ] = false ; $ this -> benchmarks [ $ key ] = $ benchmark ; }
Stops a timer running and calculates the statistics.

@param $key
Stops a timer running and calculates the statistics .