Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/php/pecl-datetime-hrtime
High resolution timing
https://github.com/php/pecl-datetime-hrtime
Last synced: about 1 month ago
JSON representation
High resolution timing
- Host: GitHub
- URL: https://github.com/php/pecl-datetime-hrtime
- Owner: php
- License: other
- Created: 2021-04-06T09:15:34.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-04-06T10:06:58.000Z (over 3 years ago)
- Last Synced: 2024-04-13T21:53:31.819Z (7 months ago)
- Language: C
- Size: 20.5 KB
- Stars: 5
- Watchers: 9
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# High resolution timer for PHP #
This PHP extension brings the possibility to use a high resolution timer from the user land PHP scripts. The best available APIs are used on differend platforms to achieve this goal.
## Synopsis ##
```php
$c = new HRTime\StopWatch;
$c->start();
/* do some interesting stuff*/
$c->stop();
$elapsed0 = $c->getLastElapsedTime(HRTime\Unit::NANOSECOND);/* do something else */
$c->start();
/* do some interesting stuff again */
$c->stop();
$elapsed1 = $c->getLastElapsedTime(HRTime\Unit::NANOSECOND);$elapsed_total = $c->getElapsedTime(HRTime\Unit::NANOSECOND);
```