ans/timer

A Simple Timer mark script

dev-master 2012-08-22 13:37 UTC

This package is auto-updated.

Last update: 2024-04-11 12:55:37 UTC


README

This script works as simple timer control to your app

Usage

<?php
include (__DIR__.'/libs/ANS/Timer/Timer.php');

$Timer = new \ANS\Timer\Timer;

$Timer->mark('Starting a mark previous to operations');

foreach ($alotofoperations as $operation) {
    $Timer->mark('Start operation '.$operation->name);

    $operation->function();

    $Timer->mark('End operation '.$operation->name);
}

$Timer->mark('Ended a mark previous to operations');

foreach ($Timer->get() as $timer) {
    echo "\n".sprintf('%01.6f', $timer['total']).' - '.$timer['text'];
}

echo "\n".$Timer->getMemoryUsage();