xp-framework/xp-framework — pull request #244 by thekid (2013-03-01 10:57:04+00:00)
Title: Timer::measure(<callable>)

This pull request picks up on [this idea](https://github.com/xp-framework/rfc/issues/265#issuecomment-12752897) in xp-framework/rfc#265 and extends the `util.profiling.Timer` class with the possibility to measure a closure.

Example:

```php
$timer= new Timer();
$timer->measure(function() {
// This is where the stuff happens
});
$elaped= $timer->elapsedTime();
```

*You can also pass anything deemed [callable](http://php.net/manual/en/language.types.callable.php) by PHP*