src/Tracing/Tracing.php
protected function diffTimeInNanoseconds($start, $end): int
    {
        if ($this->platformSupportsNanoseconds()) {
            return $end - $start;
        }

        // Difference is in seconds (with microsecond precision)
        // * 1000 to get to milliseconds
        // * 1000 to get to microseconds
        // * 1000 to get to nanoseconds
        return (int) (($end - $start) * 1000 * 1000 * 1000);
    }
protected function diffTimeInNanoseconds($start, $end): int
    {
        if ($this->platformSupportsNanoseconds()) {
            return $end - $start;
        }

        // Difference is in seconds (with microsecond precision)
        // * 1000 to get to milliseconds
        // * 1000 to get to microseconds
        // * 1000 to get to nanoseconds
        return (int) (($end - $start) * 1000 * 1000 * 1000);
    }
protected function diffTimeInNanoseconds ( $ start , $ end ) : int { if ( $ this -> platformSupportsNanoseconds ( ) ) { return $ end - $ start ; } // Difference is in seconds (with microsecond precision) // * 1000 to get to milliseconds // * 1000 to get to microseconds // * 1000 to get to nanoseconds return ( int ) ( ( $ end - $ start ) * 1000 * 1000 * 1000 ) ; }
Diff the time results to each other and convert to nanoseconds if needed.

@param  float|int  $start
@param  float|int  $end
@return int
Diff the time results to each other and convert to nanoseconds if needed .