Returns the latency factory
506866
public double getLatencyFactor()
  {
    long now = CurrentTime.currentTime();

    long decayPeriod = 60000;

    long delta = decayPeriod - (now - _lastSuccessTime);

    // decay the latency factor over 60s
    
    if (delta <= 0)
      return 0;
    else
      return (_latencyFactor * delta) / decayPeriod;
  }
219411
private static JsJmsMessageFactoryImpl getJmsFactory() {
    if (jmsFactory == null) {
      try {
        jmsFactory = (JsJmsMessageFactoryImpl)JsJmsMessageFactory.getInstance();
      } catch (Exception e) {
        /* A Console error message will have been written for the underlying problem */
        FFDCFilter.processException(e, "<clinit>", "116");
      }
    }
    return jmsFactory;
  }
692575
def GetHostProcessorSpeed(self):
        ''''''
        counter = c_uint()
        ret = vmGuestLib.VMGuestLib_GetHostProcessorSpeed(self.handle.value, byref(counter))
        if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
        return counter.value
55103
def _on_client_latency_changed(self, data):
        """"""
        self._clients.get(data.get('id')).update_latency(data)
988256
public final ClientSocketFactory getLoadBalanceSocketPool()
  {
    ClientSocketFactory factory = getLoadBalanceSocketFactory();
    
    if (factory == null)
      return null;
    
    if (_serverBartender.getState().isDisableSoft()) {
      factory.enableSessionOnly();
    }
    else if (_serverBartender.getState().isDisabled()){
      // server/269g
      factory.disable();
    }
    else {
      factory.enable();
    }
    
    return factory;
  }
976982
def get_using_network_time():
    '''
    
    '''
    ret = salt.utils.mac_utils.execute_return_result(
        'systemsetup -getusingnetworktime')

    return salt.utils.mac_utils.validate_enabled(
        salt.utils.mac_utils.parse_return(ret)) == 'on'
1127090
private Long calculateRequestLatency(TimingInfo timingInfo) {
        if (timingInfo == null) {
            return null;
        }

        TimingInfo httpClientSendRequestTime = timingInfo.getLastSubMeasurement(AWSRequestMetrics.Field.HttpClientSendRequestTime
                                                                                    .name());
        TimingInfo httpClientReceiveResponseTime = timingInfo.getLastSubMeasurement(AWSRequestMetrics.Field
                                                                                        .HttpClientReceiveResponseTime.name());
        if (httpClientSendRequestTime != null && httpClientSendRequestTime.getTimeTakenMillisIfKnown() != null &&
            httpClientReceiveResponseTime != null && httpClientReceiveResponseTime.getTimeTakenMillisIfKnown() != null) {
            return httpClientSendRequestTime.getTimeTakenMillisIfKnown().longValue()
                   + httpClientReceiveResponseTime.getTimeTakenMillisIfKnown().longValue();
        }
        return null;
    }
664509
function() {
      var timings = {};
      var requests = win.performance.getEntriesByType("resource");
      for (var i = 0; i < requests.length; i++)
        timings[requests[i].name] = requests[i].responseEnd;
      for (var j = 0; j < rects.length; j++) {
        if (!('tm' in rects[j]))
          rects[j].tm = timings[rects[j].url] !== undefined ? timings[rects[j].url] : 0;
      }
    }
1371028
def factory(cls, endpoint, timeout, *args, **kwargs):
        
        start = time.time()
        kwargs['connect_timeout'] = timeout
        conn = cls(endpoint, *args, **kwargs)
        elapsed = time.time() - start
        conn.connected_event.wait(timeout - elapsed)
        if conn.last_error:
            if conn.is_unsupported_proto_version:
                raise ProtocolVersionUnsupported(endpoint, conn.protocol_version)
            raise conn.last_error
        elif not conn.connected_event.is_set():
            conn.close()
            raise OperationTimedOut("Timed out creating connection (%s seconds)" % timeout)
        else:
            return conn
170148
function getHrTimeDurationInMs (startTime, endTime) {
    if (startTime === null || endTime === null) {
        return null;
    }

    var secondDiff = endTime[0] - startTime[0];
    var nanoSecondDiff = endTime[1] - startTime[1];
    var diffInNanoSecond = secondDiff * NS_PER_SEC + nanoSecondDiff;

    return Math.round(diffInNanoSecond / MS_PER_NS);
}
1129430
private AbstractConnectionFactory getCachingConnectionFactory(String queueName,
            List<String> processList) throws RabbitmqCommunicateException
    {
        AbstractConnectionFactory connectionFactory = null;
        try
        {
            connectionFactory = (AbstractConnectionFactory) getContextBuilder().getConnectionFactory(
                    queueName);
        }
        catch (Exception ex)
        {
            throw new RabbitmqCommunicateException(ex);
        }

        String adresses = StringUtils.join(processList, ',');
        connectionFactory.setAddresses(adresses);
        return connectionFactory;
    }
1210671
public static TensorFactory getFactory() {
    return new TensorFactory() {
      @Override
      public TensorBuilder getBuilder(int[] dimNums, int[] dimSizes) {
        return new DenseTensorBuilder(dimNums, dimSizes);
      }
    };
  }
1353679
function PromiseFactory() {
	var deferred = whenjs.defer();
	//var timeout = setTimeout(function () { console.log(t, 'Promise timed out')}, 3000);

	this.reject = function (err) {
		deferred.reject(err);
	};
	this.resolve = function (val) {
	//	clearTimeout(timeout);
		deferred.resolve(val);
	};
	this.promise = function () {
		return deferred.promise;
	};
}
434059
def latencies(self):
        
        return [(shard_id, shard.ws.latency) for shard_id, shard in self.shards.items()]
385799
protected List<MetricDatum> latencyOfClientExecuteTime(Request<?> req, Object response) {
        AWSRequestMetrics m = req.getAWSRequestMetrics();
        TimingInfo root = m.getTimingInfo();
        final String metricName = Field.ClientExecuteTime.name();
        if (root.isEndTimeKnown()) { // being defensive
            List<Dimension> dims = new ArrayList<Dimension>();
            dims.add(new Dimension()
                    .withName(Dimensions.MetricType.name())
                    .withValue(metricName));
            // request type specific
            dims.add(new Dimension()
                    .withName(Dimensions.RequestType.name())
                    .withValue(requestType(req)));
            MetricDatum datum = new MetricDatum()
                .withMetricName(req.getServiceName())
                .withDimensions(dims)
                .withUnit(StandardUnit.Milliseconds)
                .withValue(root.getTimeTakenMillisIfKnown());
            return Collections.singletonList(datum);
        }
        return Collections.emptyList();
    }
1168126
def GetNetworkAddressWithTime(self):
        
        if self.port is not None and self.host is not None and self.Version is not None:
            return NetworkAddressWithTime(self.host, self.port, self.Version.Services)
        return None
109955
async def factory(self, request, path = "/", as_ = None):
    
    counter, time = perf_counter(), process_time()
    if not path.startswith("/"):
      path = "/{}".format(path)

    resp = await self.resolve_path(path)
    if resp:
      if "path" not in request.json:
        request.json["path"] = path

      method = getattr(resp["model"], resp["model"].factories[as_] if hasattr(resp["model"], "factories") and as_ in resp["model"].factories else "create_child")
      result = await method(request, as_)
      code = result.code if issubclass(result.__class__, ErrorSchema) else 201
      result = result.to_plain_dict()

      result['pref_counter'] = (perf_counter() - counter) * 1000
      result['process_time'] = (process_time() - time) * 1000
      return response.json(result, code)
    else:
      error = self.models.ErrorSchema()
      error.load({"message": "{} not found".format(path), "code": 404})
      return response.json(error.to_plain_dict(), 404)