Пример #1
0
 public function getPrettyAverageDuration()
 {
     return Duration::create()->limitPeriods(2)->format($this->duration / $this->operations / 1000);
 }
Пример #2
0
 private function showSummary($microseconds)
 {
     $statusFileMap = $this->getFilesGroupedByStatus();
     $changedCount = 0;
     if (isset($statusFileMap[FormatJobFile::STATUS_CHANGED])) {
         $changedCount = count($statusFileMap[FormatJobFile::STATUS_CHANGED]);
     }
     $duration = Duration::create()->format((int) $microseconds) . ' ';
     if ($microseconds < 10) {
         if ($microseconds < 1) {
             $duration = '';
         }
         $duration .= round(($microseconds - (int) $microseconds) * 1000) . 'ms';
     }
     $this->stdio->success(sprintf('Formatted %d file%s in %s.', $changedCount, Quantity::format('(s)', $changedCount), $duration));
 }