src/Comely/Kernel/Toolkit/Time.php
public static function difference(int $stamp1, int $stamp2 = null): int
    {
        if (!is_int($stamp2)) {
            $stamp2 = time();
        }

        return $stamp2 > $stamp1 ? $stamp2 - $stamp1 : $stamp1 - $stamp2;
    }
public static function difference(int $stamp1, int $stamp2 = null): int
    {
        if (!is_int($stamp2)) {
            $stamp2 = time();
        }

        return $stamp2 > $stamp1 ? $stamp2 - $stamp1 : $stamp1 - $stamp2;
    }
public static function difference ( int $ stamp1 , int $ stamp2 = null ) : int { if ( ! is_int ( $ stamp2 ) ) { $ stamp2 = time ( ) ; } return $ stamp2 > $ stamp1 ? $ stamp2 - $ stamp1 : $ stamp1 - $ stamp2 ; }
Number of seconds elapsed between 2 timestamps

@param int $stamp1
@param int|null $stamp2
@return int
Number of seconds elapsed between 2 timestamps