Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf6a014

Browse files
committed
Merge pull request #382 from Baachi/stopwatch
Add some docs for TimedGeocoder
2 parents 7b66cf5 + 67d8cd5 commit cf6a014

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,28 @@ You can write your own `provider` by implementing the `Provider` interface.
436436

437437
You can provide your own `dumper` by implementing the `Dumper` interface.
438438

439+
TimedGeocoder
440+
-------------
441+
442+
We introduced a new feature in Geocoder 3. The `TimedGeocoder` profiles
443+
each `geocode` and `reverse` call. So you can easily figure out how many
444+
time/memory was spent for each geocoder/reverse call.
445+
446+
```php
447+
// configure you geocoder object
448+
449+
$stopwatch = new \Symfony\Component\Stopwatch\Stopwatch();
450+
$geocoder = new \Geocoder\TimedGeocoder($geocoder, $stopwatch);
451+
452+
$geocoder->geocode('Paris, France');
453+
454+
// Now you can debug your application
455+
```
456+
457+
We use the [symfony/stopwatch](http://symfony.com/doc/current/components/stopwatch.html)
458+
component under the hood. Which means, if you use the symfony framework the
459+
geocoder calls will appear in your timeline section in the webprofiler.
460+
439461

440462
Versioning
441463
----------

0 commit comments

Comments
 (0)