fyre / timer
A timer library.
v3.0.10
2024-06-29 01:43 UTC
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.59
- fyre/php-cs-fixer-config: ^1.0
- phpunit/phpunit: ^10
README
FyreTimer is a free, open-source timer library for PHP.
Table Of Contents
Installation
Using Composer
composer require fyre/timer
In PHP:
use Fyre\Utility\Timer;
Methods
All
Get all timers.
$timers = Timer::all();
Clear
Clear all timers.
Timer::clear();
Count
Get the number of timers.
$timerCount = Timer::count();
Elapsed
Get the elapsed time for a timer.
$name
is a string representing the timer name.
$elapsed = Timer::elapsed($name);
Get
Get a timer.
$name
is a string representing the timer name.
$timer = Timer::get($name);
Has
Check if a timer exists.
$name
is a string representing the timer name.
$hasTimer = Timer::has($name);
Is Stopped
Determine whether a timer is stopped.
$name
is a string representing the timer name.
$isStopped = Timer::isStopped($name);
Remove
Remove a timer.
$name
is a string representing the timer name.
$removed = Timer::remove($name);
Start
Start a timer.
$name
is a string representing the timer name.
Timer::start($name);
Stop
Stop a timer.
$name
is a string representing the timer name.
Timer::stop($name);
Stop All
Stop all timers.
Timer::stopAll();