2017 © Pedro Peláez
 

library support

PragmaRX components support package

image

pragmarx/support

PragmaRX components support package

  • Saturday, February 10, 2018
  • by AntonioCarlosRibeiro
  • Repository
  • 5 Watchers
  • 24 Stars
  • 225,486 Installations
  • PHP
  • 17 Dependents
  • 0 Suggesters
  • 15 Forks
  • 3 Open issues
  • 51 Versions
  • 8 % Grown

The README.md

Support

Timer

A timer class that can be called static or dynamically., (*1)

Source code: support/blob/master/src/Timer.php, (*2)

Methods

Those are the methods:, (*3)

Timer::start();
Timer::stop();
Timer::isStarted();
Timer::isStopped();
Timer::elapsed(); // returns a formatted value 9.0192
Timer::elapsedRaw(); // returns a double 9.019223049023
Timer::setFormat(default = '%.4f');

You can name your timers and have more than one running:, (*4)

Timer::start('mary');
Timer::stop('mary');
Timer::elapsed('mary');

Examples

Timer::start();
Timer::start('2nd timer');

var_dump("started: " . (Timer::isStarted() ? 'yes' : 'no'));
var_dump("stopped: " . (Timer::isStopped() ? 'yes' : 'no'));

sleep(5);

Timer::stop();

var_dump("started: " . (Timer::isStarted() ? 'yes' : 'no'));
var_dump("stopped: " . (Timer::isStopped() ? 'yes' : 'no'));
var_dump("elapsed: " . Timer::elapsed());
var_dump("raw: " . Timer::elapsedRaw());

sleep(2);

var_dump("'2nd timer' started: " . (Timer::isStarted('2nd timer') ? 'yes' : 'no'));
var_dump("'2nd timer' stopped: " . (Timer::isStopped('2nd timer') ? 'yes' : 'no'));
var_dump("'2nd timer' elapsed: " . Timer::elapsed('2nd timer'));
var_dump("'2nd timer' raw: " . Timer::elapsedRaw('2nd timer'));

sleep(2);

Timer::stop('2nd timer');

var_dump("'2nd timer' started: " . (Timer::isStarted('2nd timer') ? 'yes' : 'no'));
var_dump("'2nd timer' stopped: " . (Timer::isStopped('2nd timer') ? 'yes' : 'no'));
var_dump("'2nd timer' elapsed: " . Timer::elapsed('2nd timer'));
var_dump("'2nd timer' raw: " . Timer::elapsedRaw('2nd timer'));

Timer::setFormat('%.8f');
var_dump("'2nd timer' elapsed 8 decimals: " . Timer::elapsed('2nd timer'));

/// And you can instantiate it and do it all over again:, (*5)

$t = new Timer;
$t->start();
sleep(3);
$t->stop();
var_dump("elapsed dynamic: " . $t->elapsed());

This should give you this result:, (*6)

string(12) "started: yes"
string(11) "stopped: no"
string(11) "started: no"
string(12) "stopped: yes"
string(15) "elapsed: 5.0004"
string(20) "raw: 5.0005040168762"
string(24) "'2nd timer' started: yes"
string(23) "'2nd timer' stopped: no"
string(27) "'2nd timer' elapsed: 7.0008"
string(32) "'2nd timer' raw: 7.0008120536804"
string(23) "'2nd timer' started: no"
string(24) "'2nd timer' stopped: yes"
string(27) "'2nd timer' elapsed: 9.0011"
string(32) "'2nd timer' raw: 9.0010931491852"
string(42) "'2nd timer' elapsed 8 decimals: 9.00113106"
string(27) "elapsed dynamic: 3.00018883"

The Versions

10/02 2018

dev-master

9999999-dev

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

10/02 2018

v0.8.8

0.8.8.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

20/12 2017

v0.8.7

0.8.7.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

07/11 2017

v0.8.5

0.8.5.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

07/11 2017

v0.8.6

0.8.6.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

27/10 2017

v0.8.4

0.8.4.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

07/10 2017

v0.8.3

0.8.3.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

12/09 2017

v0.8.2

0.8.2.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

12/09 2017

v0.8.1

0.8.1.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

04/09 2017

v0.7.4

0.7.4.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

04/09 2017

v0.8.0

0.8.0.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

03/09 2017

v0.7.3

0.7.3.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

22/08 2017

v0.7.2

0.7.2.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

20/08 2017

v0.7.0

0.7.0.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

20/08 2017

v0.7.1

0.7.1.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

16/08 2017

v0.6.16

0.6.16.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

19/02 2017

v0.6.15

0.6.15.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

31/01 2017

v0.6.14

0.6.14.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

31/01 2017

v0.6.13

0.6.13.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

31/01 2017

v0.6.12

0.6.12.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

24/11 2016

v0.6.11

0.6.11.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

21/09 2016

v0.6.10

0.6.10.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

10/09 2016

v0.6.9

0.6.9.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

31/08 2016

v0.6.8

0.6.8.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

31/08 2016

v0.6.7

0.6.7.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

31/03 2016

v0.6.6

0.6.6.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

16/02 2016

v0.6.5

0.6.5.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

24/11 2015

v0.6.4

0.6.4.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

23/11 2015

v0.6.3

0.6.3.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

24/08 2015

v0.6.2

0.6.2.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

10/03 2015

v0.6.1

0.6.1.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

06/03 2015

v0.6.0

0.6.0.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

04/03 2015

v0.5.3

0.5.3.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

21/02 2015

v0.5.2

0.5.2.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

20/02 2015

v0.5.1

0.5.1.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

18/02 2015

v0.5.0

0.5.0.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

laravel pragmarx

03/12 2014

v0.3.5

0.3.5.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel pragmarx

26/11 2014

v0.3.4

0.3.4.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel pragmarx

24/11 2014

v0.3.3

0.3.3.0

PragmaRX components support package

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel pragmarx

02/10 2014

v0.3.2

0.3.2.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel pragmarx

27/09 2014

v0.3.1

0.3.1.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel pragmarx

14/09 2014

v0.3.0

0.3.0.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel pragmarx

13/08 2014

v0.2.9

0.2.9.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel pragmarx

11/07 2014

v0.2.8

0.2.8.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel pragmarx

06/07 2014

v0.2.7

0.2.7.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel pragmarx

18/06 2014

v0.2.6

0.2.6.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel pragmarx

15/06 2014

v0.2.5

0.2.5.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel pragmarx

09/06 2014

v0.2.4

0.2.4.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel pragmarx

27/04 2014

v0.2.3

0.2.3.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel pragmarx

02/03 2014

v0.2.1

0.2.1.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel pragmarx

28/02 2014

v0.2.0

0.2.0.0

PragmaRX components support package

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel pragmarx