Skip to content

Commit 9c8834a

Browse files
committed
Add StopWatch
1 parent 1a30929 commit 9c8834a

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/Clock.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ interface Clock extends ClockInterface
1111
public function asUTC(): UTCClock;
1212

1313
public function asMicrotime(): MicrotimeClock;
14+
15+
public function stopWatch(): StopWatch;
1416
}

src/Clock/AbstractClock.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Recruiter\Clock;
88
use Recruiter\MicrotimeClock;
9+
use Recruiter\StopWatch;
910
use Recruiter\UTCClock;
1011

1112
abstract class AbstractClock implements Clock
@@ -19,4 +20,9 @@ public function asMicrotime(): MicrotimeClock
1920
{
2021
return new PsrMicrotimeClock($this);
2122
}
23+
24+
public function stopWatch(): StopWatch
25+
{
26+
return new StopWatch\ClockStopWatch($this);
27+
}
2228
}

0 commit comments

Comments
 (0)