Passed
Pull Request — master (#59)
by Alexander
26:34 queued 11:31
created

PerformanceMetrics::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
4
namespace App\Widget;
5
6
use App\Timer;
7
use Yiisoft\Widget\Widget;
8
9
class PerformanceMetrics extends Widget
10
{
11
    protected function run(): string
12
    {
13
        return sprintf(
14
            'Time: %.6f s. Memory: %.3f mb.',
15
            Timer::get('overall'),
16
            memory_get_peak_usage() / (1024 * 1024)
17
        );
18
    }
19
}
20