Displays the elapsed time since the current step started running.
973585
def elapsed_time(seconds: float) -> str:
    """"""
    environ.abort_thread()
    parts = (
        '{}'.format(timedelta(seconds=seconds))
        .rsplit('.', 1)
    )
    hours, minutes, seconds = parts[0].split(':')
    return templating.render_template(
        'elapsed_time.html',
        hours=hours.zfill(2),
        minutes=minutes.zfill(2),
        seconds=seconds.zfill(2),
        microseconds=parts[-1] if len(parts) > 1 else ''
    )
1124568
def is_running(self) -> bool:
        """"""
        return (
            self._has_started and
            self.is_alive() or
            self.completed_at is None or
            (datetime.utcnow() - self.completed_at).total_seconds() < 0.5
        )
90556
def _elapsed_time(begin_time, end_time):
    

    bt = _str2datetime(begin_time)
    et = _str2datetime(end_time)

    return float((et - bt).seconds)
845508
def show_progress(total_duration):
    """"""
    with tqdm(total=round(total_duration, 2)) as bar:
        def handler(key, value):
            if key == 'out_time_ms':
                time = round(float(value) / 1000000., 2)
                bar.update(time - bar.n)
            elif key == 'progress' and value == 'end':
                bar.update(bar.total - bar.n)
        with _watch_progress(handler) as socket_filename:
            yield socket_filename
382282
def step(self):
        # type: () -> bool
        
        with self.__lock:
            self.__value -= 1
            if self.__value == 0:
                # All done
                self.__event.set()
                return True
            elif self.__value < 0:
                # Gone too far
                raise ValueError("The counter has gone below 0")

        return False
1025009
def reportTimes(self):
        

        self.end = _ptime()
        total_time = 0
        print(ProcSteps.__report_header)
        for step in self.order:
            if 'elapsed' in self.steps[step]:
                _time = self.steps[step]['elapsed']
            else:
                _time = 0.0
            total_time += _time
            print('   %20s          %0.4f sec.' % (step, _time))

        print('   %20s          %s' % ('=' * 20, '=' * 20))
        print('   %20s          %0.4f sec.' % ('Total', total_time))
599642
def end_timing(self):
        

        if self._callback != None:
            elapsed = time.perf_counter() * 1000 - self._start
            self._callback.end_timing(self._counter, elapsed)
953851
def run_time_or_time_elapsed
      if self.end_time         
         return Time.at(self.end_time - self.start_time)
      else
         return Time.at(Time.now - self.start_time)
      end
    end
174171
def show_progress(self):
        """'"""
        if self.in_progress_hanging:
            sys.stdout.write('.')
            sys.stdout.flush()
119289
def elapsed_time(self):
        
        if self._end_time:
            elapsed_time = round(self._end_time - self._start_time, 3)
            return elapsed_time
        else:
            return None
1357723
def _display(self, sent, now, chunk, mbps):
        
        if self.parent is not None:
            self.parent._display(self.parent.offset + sent, now, chunk, mbps)
            return

        elapsed = now - self.startTime

        if sent > 0 and self.total is not None and sent <= self.total:
            eta = (self.total - sent) * elapsed.total_seconds() / sent
            eta = datetime.timedelta(seconds=eta)
        else:
            eta = None

        self.output.write(
            "\r %s: Sent %s%s%s ETA: %s (%s) %s%20s\r" % (
                elapsed,
                util.humanize(sent),
                "" if self.total is None else " of %s" % (util.humanize(self.total),),
                "" if self.total is None else " (%d%%)" % (int(100 * sent / self.total),),
                eta,
                "" if not mbps else "%.3g Mbps " % (mbps,),
                chunk or "",
                " ",
            )
        )

        self.output.flush()
689376
@Override
    public void indicateProgress(int number) {
        verifySystemOut();
        progressIndicatorActive = true;
        String currMsg = lastMessage;
        try {
            if (isAnsiEnabled()) {
                updateStatus(currMsg + ' ' + number);
            } else {
                out.print("..");
                out.print(number);
            }
        } finally {
            lastMessage = currMsg;
        }
    }
1022808
protected long elapsed ()
    {
        long current = current();
        if (_driftRatio != 1.0) {
            long elapsed = current - _priorCurrent;
            _startStamp += (elapsed - (elapsed * _driftRatio));
        }
        _priorCurrent = current;

        return current - _startStamp;
    }
965990
def set_elapsed_time_visible(self, state):
        """"""
        self.show_elapsed_time = state
        if self.time_label is not None:
            self.time_label.setVisible(state)
1306295
def elapsed(func):
    """"""

    @functools.wraps(func)
    def wrapper(*args, **kw):
        start = time.time()
        print('Running `%s()` ...' % func.__name__)
        res = func(*args, **kw)
        end = time.time()
        print('Function `%s()` running elapsed %.2f s' %
              (func.__name__, end - start))
        return res

    return wrapper
546679
def elapsed_time(self):
        
        td = (datetime.datetime.now() - self.start_time)

        sec = td.seconds
        ms = int(td.microseconds / 1000)
        return '{:02}:{:02}.{:03}'.format(sec % 3600 // 60, sec % 60, ms)
95107
def elapsed(self):
        
        if not self.start_date:
            return None
        return (self.end_date or datetime.utcnow()) - self.start_date