code: function parseDuration(value) {
    if (typeof value === 'number') return value / 1e6;
    if (typeof value !== 'string') return;
  
    var n;
    var m = value.match(/^(\d*\.?\d*)$/);
  
    if (m) {
      n = parseFloat(m[1]);
  
      if (!isNaN(n)) return n / 1e6;
    }
  
    m = value.match(/^([\d\.]*)(ns|us|ms|s|m|h)$/);
  
    if (!m) return;
  
    n = parseFloat(m[1]);
  
    if (isNaN(n)) return;
  
    return n * constants.DURATION_UNITS[m[2]] / 1e6;
  }
docs: Parse duration