README.md
1# High resolution timer for PHP #
2
3This 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.
4
5## Synopsis ##
6
7```php
8
9 $c = new HRTime\StopWatch;
10
11 $c->start();
12 /* do some interesting stuff*/
13 $c->stop();
14 $elapsed0 = $c->getLastElapsedTime(HRTime\Unit::NANOSECOND);
15
16 /* do something else */
17
18 $c->start();
19 /* do some interesting stuff again */
20 $c->stop();
21 $elapsed1 = $c->getLastElapsedTime(HRTime\Unit::NANOSECOND);
22
23 $elapsed_total = $c->getElapsedTime(HRTime\Unit::NANOSECOND);
24```