Skip to content

Commit

Permalink
Merge a994907 into 386b338
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejkupczyk committed Oct 19, 2020
2 parents 386b338 + a994907 commit 1fffacb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/Common/TimeKeeper.php
Expand Up @@ -9,12 +9,12 @@ class TimeKeeper
const DAY = 86400;

/**
* @var float
* @var float|null
*/
protected $startedAt;

/**
* @var float
* @var float|null
*/
protected $finishedAt;

Expand All @@ -32,6 +32,11 @@ public function stop()
$this->finishedAt = microtime(true);
}

public function reset()
{
$this->startedAt = $this->finishedAt = null;
}

/**
* @return float|null
*/
Expand Down
7 changes: 6 additions & 1 deletion src/Common/Timer.php
Expand Up @@ -5,7 +5,7 @@
trait Timer
{
/**
* @var \Robo\Common\TimeKeeper
* @var \Robo\Common\TimeKeeper|null
*/
protected $timer;

Expand All @@ -25,6 +25,11 @@ protected function stopTimer()
$this->timer->stop();
}

protected function resetTimer()
{
$this->timer->reset();
}

/**
* @return float|null
*/
Expand Down

0 comments on commit 1fffacb

Please sign in to comment.