Passed
Push — master ( 37cafd...a8b392 )
by
unknown
07:18
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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 5 1
A __construct() 0 3 1
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