https://github.com/carno-php/timer
https://github.com/carno-php/timer
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/carno-php/timer
- Owner: carno-php
- License: mit
- Created: 2018-08-15T09:27:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-17T08:09:09.000Z (over 6 years ago)
- Last Synced: 2025-02-24T01:03:31.432Z (3 months ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Timer - component of carno-php
# Installation
```bash
composer require carno-php/timer
```# Usages
```php
$id = Timer::loop(10, function () {
echo 'triggering every 10ms', PHP_EOL;
});
Timer::after(500, function () use ($id) {
echo 'trigger once after 500ms', PHP_EOL;
echo 'and clear previous created loop timer', PHP_EOL;
Timer::clear($id);
});
```