Return how the duration so far.

        :returns: the duration from the time the Interval was started if the
            interval is running, otherwise ``False``.
772853
def duration_so_far(self):
        
        if self._start_instant is None:
            return False
        if self._stop_instant is None:
            return int((instant() - self._start_instant) * 1000)
        return False
1313131
def resume():
    
    t = timer()
    if f.t.stopped:
        raise StoppedError("Cannot resume stopped timer.")
    if not f.t.paused:
        raise PausedError("Cannot resume timer that is not paused.")
    f.t.paused = False
    f.t.start_t = t
    f.t.last_t = t
    return t
156915
def time_period(self):
        
        if self.args.time_period is None:
            if self.args.files or is_pipe(STDIN_FILENO) or is_redirected(STDIN_FILENO):
                time_period = (None, None)
            else:
                diff = 86400  # 24h = 86400 seconds
                time_period = get_datetime_interval(int(time.time()), diff, 3600)
        else:
            time_period = self.args.time_period

        logger.debug('time period to be processed: %r', time_period)
        return time_period
1206237
def duration(self):
        
        with self.container.open_if_needed(mode='r') as cnt:
            samples, sr = cnt.get(self.key)

            return samples.shape[0] / sr
737383
def get_time_spent(self):
        
        # Take another look at this. Not sure it's correct:
        if not self.has_started or not self.has_ended():
            raise errors.IllegalState()
        if self._my_map['completionTime'] is not None:
            return self.get_completion_time() - self.get_actual_start_time()
        else:
            raise errors.IllegalState()
47781
def duration(label, stop_it=True, stop_at=None):
    """"""

    if label not in labels:
        return None

    if "duration" in labels[label]:
        return Duration(labels[label]["duration"])

    if stop_it:
        return stop(label, at=stop_at)
    else:
        return None
711911
def validity_duration(self):
        
        if self._proto.HasField('expireMillis'):
            return timedelta(milliseconds=self._proto.expireMillis)
        return None
100310
def half_duration(self):
        """"""
        if self._interval is not None:
            a, b = self._interval
            return (b - a) * .5
        else:
            return self.interval_duration * .5
223394
def duration(self):
        
        if self.end_datetime is None or self.start_datetime is None:
            return 0
        return (self.end_datetime - self.start_datetime).total_seconds()
59686
def get_runtime(self):
        """"""
        if self.start is None: return None

        if self.end is None:
            delta = datetime.datetime.now() - self.start
        else:
            delta = self.end - self.start

        return MyTimedelta.as_timedelta(delta)
737326
def elapsed_time(self) -> float:
        
        current_time = datetime.utcnow()
        start = self.start_time or current_time
        end = self.end_time or current_time
        return (end - start).total_seconds()
1069922
def duration(self):
        
        d = self.for_attempt(self.cur_attempt)
        self.cur_attempt += 1
        return d
44040
def get_duration(self):
        
        mins, secs = divmod(self.duration_sec, 60)
        hours, mins = divmod(mins, 60)
        return "%02dh %02dm %02ds" % (hours, mins, secs)
447993
def duration(self):
        
        if self.completion_ts:
            end = self.completed
        else:
            end = datetime.utcnow()
        return end - self.started
1271452
def elapsed(self):
        

        # Clock stops running when total is reached
        if self.count == self.total:
            elapsed = self.last_update - self.start
        else:
            elapsed = time.time() - self.start

        return elapsed
126722
def duration(self):
        
        if self._stop_instant is None:
            return int((instant() - self._start_instant) * 1000)
        if self._duration is None:
            self._duration = int((self._stop_instant - self._start_instant) * 1000)
        return self._duration
934051
def __run(self):
		
		self.interval_start = time.time()
		while self.status != STOPPED:
			if self.status == RUNNING:
				self.current_interval_duration = time.time() - self.interval_start

			# If max_duration is set, stop the clock if it is reached
			if self.max_duration and self.time > self.max_duration:
				self.status == STOPPED

			# One refresh per millisecond seems enough
			time.sleep(0.001)