third_party/pipeline/pipeline/ui/common.js
function getElapsedTimeString(startTimestampMs, updatedTimestampMs) {
  var updatedDiff = Math.max(0, updatedTimestampMs - startTimestampMs);
  var updatedDays = Math.floor(updatedDiff / 86400000.0);
  updatedDiff -= (updatedDays * 86400000.0);
  var updatedHours = Math.floor(updatedDiff / 3600000.0);
  updatedDiff -= (updatedHours * 3600000.0);
  var updatedMinutes = Math.floor(updatedDiff / 60000.0);
  updatedDiff -= (updatedMinutes * 60000.0);
  var updatedSeconds = Math.floor(updatedDiff / 1000.0);
  updatedDiff -= (updatedSeconds * 1000.0);
  var updatedMs = Math.floor(updatedDiff / 1.0);

  var updatedString = '';

  if (updatedMinutes > 0) {
    if (updatedDays == 1) {
      updatedString = '1 day, ';
    } else if (updatedDays > 1) {
      updatedString = '' + updatedDays + ' days, ';
    }
    updatedString +=
        leftPadNumber(updatedHours, 2, '0') + ':' +
        leftPadNumber(updatedMinutes, 2, '0') + ':' +
        leftPadNumber(updatedSeconds, 2, '0');
    if (updatedMs > 0) {
      updatedString += '.' + leftPadNumber(updatedMs, 3, '0');
    }
  } else {
    updatedString += updatedSeconds;
    updatedString += '.' + leftPadNumber(updatedMs, 3, '0');
    updatedString += ' seconds';
  }

  return updatedString;
}
function getElapsedTimeString(startTimestampMs, updatedTimestampMs) {
  var updatedDiff = Math.max(0, updatedTimestampMs - startTimestampMs);
  var updatedDays = Math.floor(updatedDiff / 86400000.0);
  updatedDiff -= (updatedDays * 86400000.0);
  var updatedHours = Math.floor(updatedDiff / 3600000.0);
  updatedDiff -= (updatedHours * 3600000.0);
  var updatedMinutes = Math.floor(updatedDiff / 60000.0);
  updatedDiff -= (updatedMinutes * 60000.0);
  var updatedSeconds = Math.floor(updatedDiff / 1000.0);
  updatedDiff -= (updatedSeconds * 1000.0);
  var updatedMs = Math.floor(updatedDiff / 1.0);

  var updatedString = '';

  if (updatedMinutes > 0) {
    if (updatedDays == 1) {
      updatedString = '1 day, ';
    } else if (updatedDays > 1) {
      updatedString = '' + updatedDays + ' days, ';
    }
    updatedString +=
        leftPadNumber(updatedHours, 2, '0') + ':' +
        leftPadNumber(updatedMinutes, 2, '0') + ':' +
        leftPadNumber(updatedSeconds, 2, '0');
    if (updatedMs > 0) {
      updatedString += '.' + leftPadNumber(updatedMs, 3, '0');
    }
  } else {
    updatedString += updatedSeconds;
    updatedString += '.' + leftPadNumber(updatedMs, 3, '0');
    updatedString += ' seconds';
  }

  return updatedString;
}
function getElapsedTimeString ( startTimestampMs , updatedTimestampMs ) { var updatedDiff = Math . max ( 0 , updatedTimestampMs - startTimestampMs ) ; var updatedDays = Math . floor ( updatedDiff / 86400000.0 ) ; updatedDiff -= ( updatedDays * 86400000.0 ) ; var updatedHours = Math . floor ( updatedDiff / 3600000.0 ) ; updatedDiff -= ( updatedHours * 3600000.0 ) ; var updatedMinutes = Math . floor ( updatedDiff / 60000.0 ) ; updatedDiff -= ( updatedMinutes * 60000.0 ) ; var updatedSeconds = Math . floor ( updatedDiff / 1000.0 ) ; updatedDiff -= ( updatedSeconds * 1000.0 ) ; var updatedMs = Math . floor ( updatedDiff / 1.0 ) ; var updatedString = '' ; if ( updatedMinutes > 0 ) { if ( updatedDays == 1 ) { updatedString = '1 day, ' ; } else if ( updatedDays > 1 ) { updatedString = '' + updatedDays + ' days, ' ; } updatedString += leftPadNumber ( updatedHours , 2 , '0' ) + ':' + leftPadNumber ( updatedMinutes , 2 , '0' ) + ':' + leftPadNumber ( updatedSeconds , 2 , '0' ) ; if ( updatedMs > 0 ) { updatedString += '.' + leftPadNumber ( updatedMs , 3 , '0' ) ; } } else { updatedString += updatedSeconds ; updatedString += '.' + leftPadNumber ( updatedMs , 3 , '0' ) ; updatedString += ' seconds' ; } return updatedString ; }
Get time string for job runtime. Specially handle number of days running as a prefix and milliseconds as a suffix. If the runtime is less than one minute, use the format "38.123 seconds" instead.
Get time string for job runtime . Specially handle number of days running as a prefix and milliseconds as a suffix . If the runtime is less than one minute use the format 38 . 123 seconds instead .