diff --git a/src/Webservice/WebserviceBootstrap.php b/src/Webservice/WebserviceBootstrap.php index 7db9c0d..7bc9635 100755 --- a/src/Webservice/WebserviceBootstrap.php +++ b/src/Webservice/WebserviceBootstrap.php @@ -23,6 +23,9 @@ class WebserviceBootstrap extends EventDispatcher { protected $app; protected $allowDebug = false; + + /** @var float */ + private $startTime; public function __construct($options=array()) { @@ -134,6 +137,7 @@ public function setAuth($user,$pass='') { } public function run() { + $this->beginTimer(); $this->app->run(); } @@ -154,5 +158,15 @@ public function getApp() { return $this->app; } + + public function beginTimer(): void + { + $this->startTime = microtime(true); + } + + public function getDuration():float + { + return microtime(true) - $this->startTime; + } }