code: public function getDuration()
      {
          $ended = microtime(true);
          if ($this->ended) {
              $ended = strtotime($this->ended);
          }
          $started = strtotime($this->started);
  
          return Date::niceDuration($ended-$started);
      }
docs: Get duration.
  
  @return [[@doctodo return_type:getDuration]] [[@doctodo return_description:getDuration]]