2017 © Pedro PelĂĄez
 

library tictactic

image

malenki/tictactic

  • Saturday, April 26, 2014
  • by malenki
  • Repository
  • 2 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

tictactic

A simple timer for multiple things at once
, (*1)

Quick example of use:, (*2)

``` php, (*3)

$t = \Malenki\TicTacTic::getInstance();, (*4)

$t->start('foo'); sleep(4); $t->finish('foo');, (*5)

echo "\n"; echo $t->get('foo'); echo "\n";, (*6)


Full example (avaible into source files too): ``` php include('src/Malenki/TicTacTic.php'); $t = \Malenki\TicTacTic::getInstance(); $t->start('foo'); echo "\n"; echo $t->done('foo') ? 'FOO done' : 'FOO is running'; echo "\n"; sleep(3); $t->finish('foo'); //$t->finish('thing'); // if uncommented, should throw exception echo "\n"; echo $t->done('foo') ? 'FOO done' : 'FOO is running'; echo "\n"; $t->start('bar'); sleep(2); $t->finish('bar'); $t->start('something'); sleep(1); $t->finish('something'); echo "\n"; printf('%d timers:', count($t)); echo "\n"; echo $t->get('foo'); echo "\n"; echo $t->get('bar'); echo "\n"; echo $t->get('something'); echo "\n"; printf('Averages:', count($t)); echo "\n"; echo $t->average(); echo "\n"; echo $t->average(array('foo', 'something')); // for two of them only echo "\n"; echo "\n";

And voilĂ ! Do you need a full doc for that? ;-), (*7)

The Versions

26/04 2014

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

07/12 2013

1.2.0

1.2.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

14/07 2013

1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

02/05 2013

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

  • php >=5.3.0