https://github.com/elusivecodes/fyretimer
FyreTimer is a free, open-source timer library for PHP.
https://github.com/elusivecodes/fyretimer
benchmark php timer
Last synced: 6 months ago
JSON representation
FyreTimer is a free, open-source timer library for PHP.
- Host: GitHub
- URL: https://github.com/elusivecodes/fyretimer
- Owner: elusivecodes
- License: mit
- Created: 2021-06-09T09:14:34.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-29T01:43:33.000Z (11 months ago)
- Last Synced: 2024-06-30T03:51:41.561Z (11 months ago)
- Topics: benchmark, php, timer
- Language: PHP
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FyreTimer
**FyreTimer** is a free, open-source timer library for *PHP*.
## Table Of Contents
- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Methods](#methods)## Installation
**Using Composer**
```
composer require fyre/timer
```In PHP:
```php
use Fyre\Utility\Timer;
```## Basic Usage
```php
$timer = new Timer();
```## Methods
**All**
Get all timers.
```php
$timers = $timer->all();
```**Clear**
Clear all timers.
```php
$timer->clear();
```**Count**
Get the number of timers.
```php
$count = $timer->count();
```**Elapsed**
Get the elapsed time for a timer.
- `$name` is a string representing the timer name.
```php
$elapsed = $timer->elapsed($name);
```**Get**
Get a timer.
- `$name` is a string representing the timer name.
```php
$data = $timer->get($name);
```**Has**
Check if a timer exists.
- `$name` is a string representing the timer name.
```php
$hasTimer = $timer->has($name);
```**Is Stopped**
Determine whether a timer is stopped.
- `$name` is a string representing the timer name.
```php
$isStopped = $timer->isStopped($name);
```**Remove**
Remove a timer.
- `$name` is a string representing the timer name.
```php
$timer->remove($name);
```**Start**
Start a timer.
- `$name` is a string representing the timer name.
```php
$timer->start($name);
```**Stop**
Stop a timer.
- `$name` is a string representing the timer name.
```php
$timer->stop($name);
```**Stop All**
Stop all timers.
```php
$timer->stopAll();
```