1: <?php
2: namespace Yep\Stopwatch;
3:
4: class Lap {
5: /** @var int|float */
6: protected $start_time;
7:
8: /** @var int|float */
9: protected $stop_time;
10:
11: /** @var int */
12: protected $memory_usage;
13:
14: public function __construct($start_time, $stop_time, $memory_usage) {
15: $this->start_time = $start_time;
16: $this->stop_time = $stop_time;
17: $this->memory_usage = $memory_usage;
18: }
19:
20: /**
21: * Returns the start time of this lap
22: *
23: * @return int|float
24: */
25: public function getStartTime() {
26: return $this->start_time;
27: }
28:
29: /**
30: * Returns the stop time of this lap
31: *
32: * @return int|float
33: */
34: public function getStopTime() {
35: return $this->stop_time;
36: }
37:
38: /**
39: * Returns the duration of this lap
40: *
41: * @return int|float
42: */
43: public function getDuration() {
44: return $this->stop_time - $this->start_time;
45: }
46:
47: /**
48: * Returns the memory usage of this lap
49: *
50: * @return int
51: */
52: public function getMemoryUsage() {
53: return $this->memory_usage;
54: }
55: }
56: