Skip to content

Commit edeb12e

Browse files
committed
Update README with a link to contributors page
1 parent e56d5be commit edeb12e

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
[![Latest Stable Version](https://poser.pugx.org/ayesh/php-timer/v/stable)](https://packagist.org/packages/ayesh/php-timer) [![License](https://poser.pugx.org/ayesh/php-timer/license)](https://packagist.org/packages/ayesh/php-timer) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Ayesh/php-timer/badges/quality-score.png?b=v2)](https://scrutinizer-ci.com/g/Ayesh/php-timer/?branch=v2) [![Build Status](https://travis-ci.org/Ayesh/php-timer.svg?branch=v2)](https://travis-ci.org/Ayesh/php-timer) [![codecov](https://codecov.io/gh/Ayesh/php-timer/branch/v2/graph/badge.svg)](https://codecov.io/gh/Ayesh/php-timer) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/54bcf54f-5087-45bf-9813-63c79a06a642/mini.png)](https://insight.sensiolabs.com/projects/54bcf54f-5087-45bf-9813-63c79a06a642) [![Too many badges](https://img.shields.io/badge/style-too_many-brightgreen.svg?style=toomany&label=badges)](https://github.com/Ayesh/php-timer)
44

55
## Synopsis
6-
A helper class to calculate how long a particular task took.
6+
A helper class to calculate how long a particular task took.
77

8-
This class is similar to phpunit/php-timer, but not a fork, nor mimic its functionality.
8+
This class is similar to phpunit/php-timer, but not a fork, nor mimic its functionality.
99

10-
- Multiple timers by a given key.
11-
- Read the current time elapsed without stopping the timer.
10+
- Multiple timers by a given key.
11+
- Read the current time elapsed without stopping the timer.
1212
- Stop the timer, and continue from where it left (stopwatch).
1313
- Dead simple API with only 4 static methods.
1414
- 100% unit test coverage.
@@ -18,46 +18,46 @@ This class is similar to phpunit/php-timer, but not a fork, nor mimic its functi
1818
## Prerequisites
1919

2020
- PHP 7.2 or later.
21-
21+
2222
## Installing
23-
The simplest way would be to install using [composer](https://getcomposer.org).
23+
The simplest way would be to install using [composer](https://getcomposer.org).
2424
```bash
2525
composer require ayesh/php-timer
2626
```
27-
28-
If, for some reason you can't use Composer, or don't want to (oh come on!), you can integrate the class with your current `PSR-4` autoloader by mapping `Ayesh\PHP_TIMER` namespace to the repository's `src` folder.
27+
28+
If, for some reason you can't use Composer, or don't want to (oh come on!), you can integrate the class with your current `PSR-4` autoloader by mapping `Ayesh\PHP_TIMER` namespace to the repository's `src` folder.
2929

3030
## Usage
31-
It is pretty simple to use the timer, with all methods being static, and allowing only 4 methods.
31+
It is pretty simple to use the timer, with all methods being static, and allowing only 4 methods.
3232

3333
#### Start timer
3434
```php
3535
<?php
3636
use Ayesh\PHP_Timer\Timer;
3737
Timer::start();
3838
````
39-
This starts the timer (actually keeps the current time stored) with the key `default`. Throughout the library, if you do not provide a specific key, this default key is used.
39+
This starts the timer (actually keeps the current time stored) with the key `default`. Throughout the library, if you do not provide a specific key, this default key is used.
4040

4141
Alternately, you can start the timer with a given key:
4242
```php
4343
Timer::start('something');
4444
```
45-
Once you start the time with a given key, you can use the same key to refer to that particular timer.
45+
Once you start the time with a given key, you can use the same key to refer to that particular timer.
4646
You can of course use PHP magic constants to make things easier:
4747
```php
4848
Timer::start(__FUNCTION__);
4949
```
50-
Attempting to start the timer with a non-string key will throw a `\TypeError` exception.
50+
Attempting to start the timer with a non-string key will throw a `\TypeError` exception.
5151
You can call the `start` method multiple times even if the timer has started. It will not reset the timer.
5252

5353
#### Read timer
54-
After starting the timer, you can read the elapsed time at any time. Reading the time will not stop the timer. You can read the timer, do some expensive calculations, and read again to get the cumulative time.
54+
After starting the timer, you can read the elapsed time at any time. Reading the time will not stop the timer. You can read the timer, do some expensive calculations, and read again to get the cumulative time.
5555
```php
56-
Timer::read(); // Default timer.
57-
Timer::read('default'); // Default timer.
56+
Timer::read(); // Default timer.
57+
Timer::read('default'); // Default timer.
5858
Timer::read('something'); // Timer started with key "something".
5959
```
60-
Attempting to read a timer that is not started will throw an `\LogicException` exception.
60+
Attempting to read a timer that is not started will throw an `\LogicException` exception.
6161

6262
##### Formats
6363
You can pass a second argument to let this library make minimal processing for you:
@@ -66,35 +66,35 @@ You can pass a second argument to let this library make minimal processing for y
6666
```
6767
See the formats section below for the formats supported.
6868
#### Stop timer
69-
You can stop the timer anytime as well. This makes the library store the stop time, and your further `Timer::read()` calls will always return the time it took between start and stop.
69+
You can stop the timer anytime as well. This makes the library store the stop time, and your further `Timer::read()` calls will always return the time it took between start and stop.
7070
```php
71-
Timer::stop(); // Default timer.
71+
Timer::stop(); // Default timer.
7272
Timer::stop('something'); // Timer started with key "something"
7373
```
74-
Attempting to stop a timer that is not started will throw an `\LogicException` exception.
74+
Attempting to stop a timer that is not started will throw an `\LogicException` exception.
7575

7676
#### Reset timer
77-
By default, starting the timer after stopping it will continue it from where it left off. For example, if you have 3 seconds on the timer when you stop it, and start it again, the total time will start from 3 seconds. You can explicitly reset the timer to make it start from 0.
78-
Resetting the timer will not make the timer start again. You need to explicitly start the timer again with a `Timer::start()` call.
77+
By default, starting the timer after stopping it will continue it from where it left off. For example, if you have 3 seconds on the timer when you stop it, and start it again, the total time will start from 3 seconds. You can explicitly reset the timer to make it start from 0.
78+
Resetting the timer will not make the timer start again. You need to explicitly start the timer again with a `Timer::start()` call.
7979
```php
80-
Timer::reset(); // Default timer.
81-
Timer::reset('something');
80+
Timer::reset(); // Default timer.
81+
Timer::reset('something');
8282
Timer::resetAll(); // Resets all timers.
8383
```
8484
## Formats
8585
Currently, the following formats are provided:
8686

8787
- `FORMAT_PRECISE`: Precise timer value, without rounding it. e.g. `0.10180473327637`
8888
- `FORMAT_MILLISECONDS`: Time in milliseconds, rounded to 2 decimals.
89-
- `FORMAT_SECONDS`: Time in seconds, rounded to 3 decimals.
89+
- `FORMAT_SECONDS`: Time in seconds, rounded to 3 decimals.
9090

9191
## Examples
9292

9393
#### Calculate the timer one-off:
9494
```php
9595
<?php
9696
use Ayesh\PHP_Timer\Timer;
97-
97+
9898
Timer::start();
9999
// do your processing here.
100100
$time = Timer::read('default', Timer::FORMAT_SECONDS);
@@ -104,19 +104,19 @@ Currently, the following formats are provided:
104104
```php
105105
<?php
106106
use Ayesh\PHP_Timer\Timer;
107-
107+
108108
Timer::start('full');
109109

110110
Timer::start('laps');
111111
sleep(1);
112112
Timer::stop('laps');
113-
113+
114114
sleep(2); // This time is not calculated under 'laps'
115-
115+
116116
Timer::start('laps');
117117
sleep(1);
118118
Timer::stop('laps');
119-
119+
120120
echo Timer::read('full', Timer::FORMAT_SECONDS); // 4 seconds.
121121
echo "<br />";
122122
echo Timer::read('laps', Timer::FORMAT_SECONDS); // 2 seconds (1 + 1)
@@ -125,6 +125,6 @@ Currently, the following formats are provided:
125125
All issues are PRs are welcome. Travis CI and PHPUnit tests are included. If you are adding new features, please make sure to add the test coverage.
126126

127127
## Credits
128-
By [Ayesh Karunaratne](https://ayesh.me).
128+
By [Ayesh Karunaratne](https://ayesh.me) and [contributors](https://github.com/Ayesh/php-timer/graphs/contributors).
129129

130130
kthxbye

0 commit comments

Comments
 (0)