2017 © Pedro Peláez
 

library chronos

Coercive Chronos Log Utility

image

coercive/chronos

Coercive Chronos Log Utility

  • Wednesday, February 7, 2018
  • by Coercive
  • Repository
  • 1 Watchers
  • 2 Stars
  • 766 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 15 % Grown

The README.md

Coercive Chronos Log Utility

The Chronos Log Utility allows you to accurately measure the execution time of a script, and that from the server startup., (*1)

Get

composer require coercive/chronos

Usage

use Coercive\Utility\Chronos

# Monitor a sleep
Chronos::start('sleep');
sleep(2);
Chronos::stop('sleep');

# Monitor some code process
Chronos::start('sha1');
$datas = [];
foreach (range(0,1000000) as $i) {
    $datas[] = sha1($i);
}
Chronos::stop('sha1');

# Monitor an other code process
Chronos::start('concat');
foreach($datas as &$data) {
    $data .= '_add_datas_' . rand(0,1000);
}
Chronos::stop('concat');

# Monitor an other code process
Chronos::start('rand_waits');
foreach (range(0,5) as $secondes) {
    sleep($secondes);
    Chronos::lap('sleeps', 'Waiting ' . $secondes . ' secondes');
}
Chronos::stop('rand_waits');

# And now : retrieve monitoring datas !

# Full diff of all process
error_log(print_r(Chronos::diff(), true));

# Diff of sha1 process
error_log(print_r(Chronos::diff('sha1'), true));

# Diff of concat process
error_log(print_r(Chronos::diff('concat'), true));

# Retrieve full datas as array
error_log(print_r(Chronos::get(), true));

The Versions

07/02 2018

dev-master

9999999-dev http://coercive.fr

Coercive Chronos Log Utility

  Sources   Download

MIT GNU

The Requires

  • php >=5.4.0

 

07/02 2018

1.0.2

1.0.2.0 http://coercive.fr

Coercive Chronos Log Utility

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

29/09 2016

1.0.1

1.0.1.0 http://coercive.fr

Coercive Chronos Log Utility

  Sources   Download

GNU

The Requires

  • php >=5.4.0

 

10/07 2016

1.0.0

1.0.0.0 http://coercive.fr

Coercive Chronos Log Utility

  Sources   Download

GNU

The Requires

  • php >=5.4.0