Java Code Examples for java.util.concurrent.TimeUnit.toMicros()

The following are Jave code examples for showing how to use toMicros() of the java.util.concurrent.TimeUnit class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: grpc-proxy   File: Recorder.java   Source Code and License Vote up 5 votes
public Recorder(long minLatency, long maxLatency, long goalLatency, TimeUnit latencyUnit) {
  this.goalLatency = latencyUnit.toMicros(goalLatency);
  this.count = new IntervalAdder();
  this.responseTime = new IntervalAdder();
  this.latency =
      new org.HdrHistogram.Recorder(
          latencyUnit.toMicros(minLatency), latencyUnit.toMicros(maxLatency), 1);
  this.histogram = latency.getIntervalHistogram(); // preload reporting histogram
}
 
Example 2
Project: guava-mock   File: SmoothRateLimiter.java   Source Code and License Vote up 4 votes
SmoothWarmingUp(
    SleepingStopwatch stopwatch, long warmupPeriod, TimeUnit timeUnit, double coldFactor) {
  super(stopwatch);
  this.warmupPeriodMicros = timeUnit.toMicros(warmupPeriod);
  this.coldFactor = coldFactor;
}
 
Example 3
Project: googles-monorepo-demo   File: SmoothRateLimiter.java   Source Code and License Vote up 4 votes
SmoothWarmingUp(
    SleepingStopwatch stopwatch, long warmupPeriod, TimeUnit timeUnit, double coldFactor) {
  super(stopwatch);
  this.warmupPeriodMicros = timeUnit.toMicros(warmupPeriod);
  this.coldFactor = coldFactor;
}