Skip to content

Commit

Permalink
Update WebserviceBootstrap.php
Browse files Browse the repository at this point in the history
add duration management
  • Loading branch information
raphael-homann authored Mar 18, 2021
1 parent 94603e0 commit 3e2bd32
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Webservice/WebserviceBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class WebserviceBootstrap extends EventDispatcher {
protected $app;

protected $allowDebug = false;

/** @var float */
private $startTime;

public function __construct($options=array())
{
Expand Down Expand Up @@ -134,6 +137,7 @@ public function setAuth($user,$pass='') {
}

public function run() {
$this->beginTimer();
$this->app->run();
}

Expand All @@ -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;
}

}

0 comments on commit 3e2bd32

Please sign in to comment.