Writing specifies the amount of time the motor will run when using the
        `run-timed` command. Reading returns the current value. Units are in
        milliseconds.
5730
def time_sp(self):
        
        self._time_sp, value = self.get_attr_int(self._time_sp, 'time_sp')
        return value
554030
function getMilliseconds( time ) {
  if ( typeof time == 'number' ) {
    return time;
  }
  var matches = time.match( /(^\d*\.?\d*)(\w*)/ );
  var num = matches && matches[1];
  var unit = matches && matches[2];
  if ( !num.length ) {
    return 0;
  }
  num = parseFloat( num );
  var mult = msUnits[ unit ] || 1;
  return num * mult;
}
837872
public static String printTiming(long start, long end) {
    long totalMillis = end - start;
    long mins = TimeUnit.MILLISECONDS.toMinutes(totalMillis);
    long secs = TimeUnit.MILLISECONDS.toSeconds(totalMillis) - TimeUnit.MINUTES.toSeconds(mins);
    long millis =
        TimeUnit.MILLISECONDS.toMillis(totalMillis) - TimeUnit.MINUTES.toMillis(mins) - TimeUnit.SECONDS.toMillis(secs);
    return String.format("%d min, %d sec, %d millis", mins, secs, millis);
  }
502919
def runtime(self):
        """"""
        if self._start_time is None:
            return self._run_time
        else:
            return self._run_time + (time.time() - self._start_time)
1331689
def seconds(self):
        
        seconds = self.elapsed().seconds
        if self.limit() and self.countdown():
            seconds = (self.limit() - self.elapsed().seconds)
        return (seconds % 3600) % 60
631545
def run_timeit(self, stmt, setup):
        
        _timer = timeit.Timer(stmt=stmt, setup=setup)
        trials = _timer.repeat(self.timeit_repeat, self.timeit_number)
        self.time_average_seconds = sum(trials) / len(trials) / self.timeit_number
        # Convert into reasonable time units
        time_avg = convert_time_units(self.time_average_seconds)
        return time_avg
809865
def _parse_time(self, value):
        
        try:
            # Default time unit is a second, we should convert it to milliseconds.
            return int(value) * 1000
        except ValueError:
            # Try to parse if we are unlucky to cast value into int.
            m = self.time_format.match(value)
            if not m:
                raise ValueError("Could not parse time represented by '{t}'".format(t=value))
            time = int(m.group('time'))
            if m.group('units') != 'ms':
                time *= 1000
            return time
477949
def metric(self, name, count, elapsed):
        

        if name is None:
            warnings.warn("Ignoring unnamed metric", stacklevel=3)
            return

        with self.lock:
            self.writer.writerow((name, count, "%f"%elapsed))
267297
def fmt_second(time_total):
    

    def _ck(t):
        return t < 10 and "0%s" % t or t

    times = int(time_total)
    h = times / 3600
    m = times % 3600 / 60
    s = times % 3600 % 60
    return "%s:%s:%s" % (_ck(h), _ck(m), _ck(s))
452643
def _get_speed(element_duration, wpm, word_ref=WORD):
    
    seconds_per_dot = _seconds_per_dot(word_ref)
    if element_duration is None and wpm is None:
        # element_duration = 1
        # wpm = seconds_per_dot / element_duration
        wpm = WPM
        element_duration = wpm_to_duration(wpm, output='float', word_ref=WORD) / 1000.0
        return element_duration, wpm
    elif element_duration is not None and wpm is None:
        wpm = seconds_per_dot / element_duration
        return element_duration, wpm
    elif element_duration is None and wpm is not None:
        element_duration = wpm_to_duration(wpm, output='float', word_ref=WORD) / 1000.0
        return element_duration, wpm
    else:
        raise NotImplementedError("Can't set both element_duration and wpm")
948156
def elapsed(self):
        """"""
        if not self.started or self._start_time is None:
            return 0.0
        return self._timing_data[-1][0] - self._start_time
1314999
def timeit(self, metric, func, *args, **kwargs):
        
        (res, seconds) = timeit(func, *args, **kwargs)
        self.timing(metric, seconds * 1000.0)
        return res
847081
def to_native_units(self, motor):
        
        assert abs(self.degrees_per_second) <= motor.max_dps,\
            "invalid degrees-per-second: {} max DPS is {}, {} was requested".format(
            motor, motor.max_dps, self.degrees_per_second)
        return self.degrees_per_second/motor.max_dps * motor.max_speed
575714
def execution_time(object):
    

    @functools.wraps(object)
    def execution_time_wrapper(*args, **kwargs):
        """
        Implements execution timing.

        :param \*args: Arguments.
        :type \*args: \*
        :param \*\*kwargs: Keywords arguments.
        :type \*\*kwargs: \*\*
        :return: Object.
        :rtype: object
        """

        start_time = time.time()

        value = object(*args, **kwargs)

        end_time = time.time()

        sys.stdout.write("{0} | '{1}' object processed during '{2:f}' ms!\n".format(__name__,
                                                                                    object.__name__,
                                                                                    (end_time - start_time) * 1000.0))

        return value

    return execution_time_wrapper
328398
def speed_i(self):
        
        self._speed_i, value = self.get_attr_int(self._speed_i, 'speed_pid/Ki')
        return value
1205018
def pprint(self, seconds):
        
        return ("%d:%02d:%02d.%03d", reduce(lambda ll, b: divmod(ll[0], b) + ll[1:], [(seconds * 1000,), 1000, 60, 60]))
1238260
public void setReadTimeout(int millis) {
		// Hack to get round Spring's dynamic loading of http client stuff
		ClientHttpRequestFactory f = getRequestFactory();
		if (f instanceof SimpleClientHttpRequestFactory) {
			((SimpleClientHttpRequestFactory) f).setReadTimeout(millis);
		}
		else {
			((HttpComponentsClientHttpRequestFactory) f).setReadTimeout(millis);
		}
	}