ans / timer
A Simple Timer mark script
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/ans/timer
Requires
- php: >=5.3.3
This package is auto-updated.
Last update: 2025-09-11 16:10:40 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();