Metrics::millitime()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 8
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SoliDry\Helpers;
4
5
/**
6
 * Class Metrics
7
 * @package SoliDry\Helpers
8
 */
9
class Metrics
10
{
11
    /**
12
     * @return string
13
     */
14
    public static function millitime()
15
    {
16
        $microtime = microtime();
17
        $comps = explode(' ', $microtime);
18
19
        // Note: Using a string here to prevent loss of precision
20
        // in case of "overflow" (PHP converts it to a double)
21
        return sprintf('%d%03d', $comps[1], $comps[0] * 1000);
22
    }
23
}