Passed
Push — master ( a4c20e...52e05d )
by
unknown
23:57 queued 17:16
created

Timer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Files\Backend\Seafile\Model;
6
7
/**
8
 * Simple Timer.
9
 */
10
final readonly class Timer implements \Stringable {
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_READONLY, expecting T_CLASS on line 10 at column 6
Loading history...
11
	private float $start;
12
13
	public function __construct() {
14
		$this->start = microtime(true);
15
	}
16
17
	public function __toString(): string {
18
		$time = microtime(true) - $this->start;
19
20
		return \sprintf('%.3F', $time);
21
	}
22
}
23