2017 © Pedro Peláez
 

library timer

image

digivo/timer

  • Tuesday, January 3, 2017
  • by digivo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 12 % Grown

The README.md

Timer Trait

Provides start, end, lap and elapsed timing., (*1)

Usage

<?php

namespace App\Controller;

use Digivo\Timer\TimerTrait;

class FunController
{
    use TimerTrait;

    public function run()
    {
        $this->startTimer('app');

        sleep(2);

        $this->splitTimer('app', 'Woke up for a while');

        sleep(1);

        $this->splitTimer('app', 'Another little nap');        

        sleep(3);

        $this->stopTimer('app');

        var_export($this->returnTimer('app'));
    }
}

array (
  'app' => array (
    'start' => 1482484048.9344,
    'splits' => array (
      0 => array (
        'time' => 2.0002,
        'lap' => 2.0002,
        'end' => 1482484050.9346,
        'comment' => 'Woke up for a while',
      ),
      1 => array (
        'time' => 3.0005,
        'lap' => 1.0003,
        'end' => 1482484051.9349,
        'comment' => 'Another little nap',
      ),
    ),
    'end' => 1482484054.9351,
    'time' => 6.0007,
  ),
)

The Versions

03/01 2017

dev-master

9999999-dev

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

by Adam Prickett (Digivo)

03/01 2017

0.3

0.3.0.0

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

by Adam Prickett (Digivo)

23/12 2016

0.2

0.2.0.0

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

by Adam Prickett (Digivo)

23/12 2016

0.1

0.1.0.0

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

by Adam Prickett