src/Workout/Track.php
public function duration()
    {
        $start = $this->startDateTime();
        $end = $this->endDateTime();

        $dateDifference = $start->diff($end);

        $dateInterval = new DateInterval('PT1S');
        $dateInterval->y = $dateDifference->y;
        $dateInterval->m = $dateDifference->m;
        $dateInterval->d = $dateDifference->d;
        $dateInterval->h = $dateDifference->h;
        $dateInterval->i = $dateDifference->i;
        $dateInterval->s = $dateDifference->s;
        $dateInterval->invert = $dateDifference->invert;
        $dateInterval->days = $dateDifference->days;

        return $dateInterval;
    }
public function duration()
    {
        $start = $this->startDateTime();
        $end = $this->endDateTime();

        $dateDifference = $start->diff($end);

        $dateInterval = new DateInterval('PT1S');
        $dateInterval->y = $dateDifference->y;
        $dateInterval->m = $dateDifference->m;
        $dateInterval->d = $dateDifference->d;
        $dateInterval->h = $dateDifference->h;
        $dateInterval->i = $dateDifference->i;
        $dateInterval->s = $dateDifference->s;
        $dateInterval->invert = $dateDifference->invert;
        $dateInterval->days = $dateDifference->days;

        return $dateInterval;
    }
public function duration ( ) { $ start = $ this -> startDateTime ( ) ; $ end = $ this -> endDateTime ( ) ; $ dateDifference = $ start -> diff ( $ end ) ; $ dateInterval = new DateInterval ( 'PT1S' ) ; $ dateInterval -> y = $ dateDifference -> y ; $ dateInterval -> m = $ dateDifference -> m ; $ dateInterval -> d = $ dateDifference -> d ; $ dateInterval -> h = $ dateDifference -> h ; $ dateInterval -> i = $ dateDifference -> i ; $ dateInterval -> s = $ dateDifference -> s ; $ dateInterval -> invert = $ dateDifference -> invert ; $ dateInterval -> days = $ dateDifference -> days ; return $ dateInterval ; }
Get the duration of the track.

@return DateInterval
Get the duration of the track .