src/Debugger/Bar/TracePanel.php
public function time($time, $precision = 0)
    {
        $units = 's';
        if ($time < 1e-6) {    // <1us
            $units = 'ns';
            $time *= 1e9;

        } elseif ($time < 1e-3) { // <1ms
            $units = "\xc2\xb5s";
            $time *= 1e6;

        } elseif ($time < 1) { // <1s
            $units = 'ms';
            $time *= 1e3;
        }

        return \round($time, $precision) . ' ' . $units;
    }
public function time($time, $precision = 0)
    {
        $units = 's';
        if ($time < 1e-6) {    // <1us
            $units = 'ns';
            $time *= 1e9;

        } elseif ($time < 1e-3) { // <1ms
            $units = "\xc2\xb5s";
            $time *= 1e6;

        } elseif ($time < 1) { // <1s
            $units = 'ms';
            $time *= 1e3;
        }

        return \round($time, $precision) . ' ' . $units;
    }
public function time ( $ time , $ precision = 0 ) { $ units = 's' ; if ( $ time < 1e-6 ) { // <1us $ units = 'ns' ; $ time *= 1e9 ; } elseif ( $ time < 1e-3 ) { // <1ms $ units = "\xc2\xb5s" ; $ time *= 1e6 ; } elseif ( $ time < 1 ) { // <1s $ units = 'ms' ; $ time *= 1e3 ; } return \ round ( $ time , $ precision ) . ' ' . $ units ; }
Template helper converts seconds to ns, us, ms, s.

@param  float $time      time interval in seconds
@param  int   $precision part precision

@return string  formated time
Template helper converts seconds to ns us ms s .