diff --git a/src/pocketmine/timings/TimingsHandler.php b/src/pocketmine/timings/TimingsHandler.php index 11db46a3a..43790b299 100644 --- a/src/pocketmine/timings/TimingsHandler.php +++ b/src/pocketmine/timings/TimingsHandler.php @@ -184,6 +184,12 @@ class TimingsHandler{ } } + public function time(\Closure $closure) : void{ + $this->startTiming(); + $closure(); + $this->stopTiming(); + } + public function reset() : void{ $this->count = 0; $this->curCount = 0;