public function getDuration()
    {
        $start = $this->getStarted();

        if (empty($start)) {
            return 0;
        }

        $end = $this->getFinished();

        if (empty($end)) {
            $end = new \DateTime();
        }

        return $end->getTimestamp() - $start->getTimestamp();
    }
public function getDuration()
    {
        $start = $this->getStarted();

        if (empty($start)) {
            return 0;
        }

        $end = $this->getFinished();

        if (empty($end)) {
            $end = new \DateTime();
        }

        return $end->getTimestamp() - $start->getTimestamp();
    }
public function getDuration ( ) { $ start = $ this -> getStarted ( ) ; if ( empty ( $ start ) ) { return 0 ; } $ end = $ this -> getFinished ( ) ; if ( empty ( $ end ) ) { $ end = new \ DateTime ( ) ; } return $ end -> getTimestamp ( ) - $ start -> getTimestamp ( ) ; }
Get the number of seconds a build has been running for.
@return int
Get the number of seconds a build has been running for .