Passed
Push — master ( 37cafd...a8b392 )
by
unknown
07:18
created

Timer::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Files\Backend\Seafile\Model;
6
7
/**
8
 * Simple Timer
9
 */
10
final class Timer
11
{
12
    private float $start;
13
14
    public function __construct()
15
    {
16
        $this->start = microtime(true);
17
    }
18
19
    public function __toString(): string
20
    {
21
        $time = microtime(true) - $this->start;
22
23
        return \sprintf('%.3F', $time);
24
    }
25
}
26