function stop(): int {
        if($this->timer === null) {
            return 0;
        }
        
        if($this->nativeHrtime) {
            $elapsed = (int) (\hrtime(true) - $this->timer);
        } elseif($this->hrtime) {
            $this->timer->stop();
            $elapsed = (int) $this->timer->getElapsedTime(\HRTime\Unit::NANOSECOND);
        } else {
            $elapsed = \microtime(true) - $this->timer;
            $elapsed = \ceil(($elapsed * 1000000000));
        }
        
        return ((int) $elapsed);
    }