Returns DOM last load time for given interval and {@link TimeUnit}.

@param intervalName name of the interval
@param unit         {@link TimeUnit}
@return DOM last load time
767104
public long getDomLastLoadTime(final String intervalName, final TimeUnit unit) {
		return unit.transformMillis(domLastLoadTime.getValueAsLong(intervalName));
	}
1321815
public long now(@NonNull TimeUnit unit) {
        return unit.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
    }
841893
public SleepBuilder<T> withInterval(long interval, TimeUnit timeUnit) {
        this.interval = timeUnit.toMillis(interval);
        return this;
    }
1245356
@Override
    public T waitTime(long time, TimeUnit unit) {
        return perform(new WaitTimeInteraction(new Duration(time, unit)));
    }
1303202
public static final TimeUnit getTimeUnit(int value)
   {
      TimeUnit result = null;

      switch (value)
      {
         case 1:
         {
            // Appears to mean "use the document format"
            result = TimeUnit.ELAPSED_DAYS;
            break;
         }

         case 2:
         {
            result = TimeUnit.HOURS;
            break;
         }

         case 4:
         {
            result = TimeUnit.DAYS;
            break;
         }

         case 6:
         {
            result = TimeUnit.WEEKS;
            break;
         }

         case 8:
         case 10:
         {
            result = TimeUnit.MONTHS;
            break;
         }

         case 12:
         {
            result = TimeUnit.YEARS;
            break;
         }

         default:
         {
            break;
         }
      }

      return result;
   }
51989
private static TimeUnit getDurationUnits(Integer value)
   {
      TimeUnit result = null;

      if (value != null)
      {
         int index = value.intValue();
         if (index >= 0 && index < DURATION_UNITS.length)
         {
            result = DURATION_UNITS[index];
         }
      }

      if (result == null)
      {
         result = TimeUnit.DAYS;
      }

      return (result);
   }
1146125
public double getAverageDOMLoadTime(final String intervalName, final TimeUnit unit) {
		return unit.transformMillis(totalDomLoadTime.getValueAsLong(intervalName)) / numberOfLoads.getValueAsDouble(intervalName);
	}
287505
public double getErrorRate(String intervalName){
		long tr = getTotalRequests(intervalName);
		double errorRate = tr == 0? 0:((double)getErrors(intervalName))/tr;
		return (double)((int)(errorRate * 10000))/100;
	}
432175
public long getDurationInDays(String name, long defaultValue) {
        TimeUnit timeUnit = extractTimeUnit(name, defaultValue + " DAYS");
        long duration = getLong(name, defaultValue);

        return timeUnit.toDays(duration);
    }
1000281
public long getTotalDomLoadTime(final String intervalName, final TimeUnit unit) {
		return unit.transformMillis(totalDomLoadTime.getValueAsLong(intervalName));
	}
30000
@Deprecated
    public static Delay constant(int delay, TimeUnit timeUnit) {

        LettuceAssert.notNull(timeUnit, "TimeUnit must not be null");

        return constant(Duration.ofNanos(timeUnit.toNanos(delay)));
    }
66337
@Override
    public <T> CachedResource<T> getResource(
            Resource resource, Loader<T> builder, long checkInterval) throws IOException {
        if (Included.PLAIN == this.resourcesElementsProvider.getDefaultIncludedType()) {
            this.logger.trace(
                    "Resoure Aggregation Disabled, ignoring resource cache and loading '"
                            + resource
                            + "' directly");
            return this.loadResource(resource, builder);
        }

        // Look for the resource in the cache, since it has been wrapped with a SelfPopulatingCache
        // it should never return null.
        final GetResourceArguments<T> arguments = new GetResourceArguments<T>(resource, builder);
        final Element element =
                this.entryFactory.getWithData(this.resourceCache, resource, arguments);

        CachedResource<T> cachedResource = (CachedResource<T>) element.getObjectValue();
        if (this.logger.isTraceEnabled()) {
            this.logger.trace("Found " + cachedResource + " in cache");
        }

        // Found it, now check if the last-load time is within the check interval
        final long lastCheckTime = cachedResource.getLastCheckTime();
        if (lastCheckTime + checkInterval >= System.currentTimeMillis()) {
            if (this.logger.isTraceEnabled()) {
                this.logger.trace(
                        cachedResource
                                + " is within checkInterval "
                                + checkInterval
                                + ", returning");
            }
            return cachedResource;
        }
        if (this.logger.isTraceEnabled()) {
            this.logger.trace(
                    cachedResource
                            + " is older than checkInterval "
                            + checkInterval
                            + ", checking for modification");
        }

        // If the resource has not been modified return the cached resource.
        final boolean resourceModified = this.checkIfModified(cachedResource);
        if (!resourceModified) {
            cachedResource.setLastCheckTime(System.currentTimeMillis());
            this.resourceCache.put(
                    element); // do a cache put to notify the cache the object has been modified
            return cachedResource;
        }

        // The resource has been modified, reload it.
        cachedResource = this.loadResource(resource, builder);

        // Cache the loaded resource
        this.resourceCache.put(new Element(resource, cachedResource));

        if (this.logger.isDebugEnabled()) {
            this.logger.debug("Loaded and cached " + cachedResource);
        }

        return cachedResource;
    }
987486
@Override
    public long getDelay(TimeUnit unit) {
        ScheduledFuture<?> curr;
        synchronized (this.triggerContextMonitor) {
            curr = this.currentFuture;
        }
        return curr.getDelay(unit);
    }
1211938
public static Timer newTimer(String name, TimeUnit unit) {
    return new BasicTimer(MonitorConfig.builder(name).build(), unit);
  }
1371610
public com.google.api.ads.adwords.axis.v201809.cm.TimeUnit getTimeUnit() {
        return timeUnit;
    }
1142845
public long getStartTime(TimeUnit unit) {
        // FIXME use BigInteger representation
        long totalNanos = TimeUnit.SECONDS.toNanos(startTime.getEpochSecond());
        totalNanos += startTime.getNano();
        return unit.convert(totalNanos, TimeUnit.NANOSECONDS);
    }
586782
@SuppressWarnings("unchecked")
   public <UNIT extends TimeUnit> UNIT getUnit(final Class<UNIT> unitType)
   {
      if (unitType == null)
         return null;

      for (TimeUnit unit : units.keySet()) {
         if (unitType.isAssignableFrom(unit.getClass()))
         {
            return (UNIT) unit;
         }
      }
      return null;
   }