You are here

public function UltimateCronLogEntry::formatDuration in Ultimate Cron 7.2

Format duration.

File

./ultimate_cron.plugin.inc, line 1539
Plugin framework for Ultimate Cron.

Class

UltimateCronLogEntry
Abstract class for Ultimate Cron log entries.

Code

public function formatDuration() {
  $duration = $this
    ->getDuration();
  switch (TRUE) {
    case $duration >= 86400:
      $format = 'd H:i:s';
      break;
    case $duration >= 3600:
      $format = 'H:i:s';
      break;
    default:
      $format = 'i:s';
  }
  return isset($duration) ? gmdate($format, $duration) : t('N/A');
}