Get the current timer value in seconds.

        Returns: the elapsed time in seconds since the timer started or until the timer was stopped
482082
def get(self):
        
        now = datetime.now()
        if self._start_time:
            if self._stop_time:
                return (self._stop_time - self._start_time).total_seconds()
            return (now - self._start_time).total_seconds()
        return 0.
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
839222
def elapsed(t0=0.0):
    
    now = time()
    dt = now - t0
    dt_sec = Decimal(str(dt)).quantize(Decimal('.0001'), rounding=ROUND_DOWN)
    if dt_sec <= 1:
        dt_str = str(dt_sec) + ' second'
    else:
        dt_str = str(dt_sec) + ' seconds'
    return now, dt_str
1195204
def get_elapsed_time(self, issue):
        
        last_mark = None

        # Get the last mark from the work logs
        worklogs = self.get_worklog(issue)
        if worklogs:
            last_worklog = worklogs[-1]
            last_mark = dateutil.parser.parse(last_worklog.raw['updated'])

        # If no worklogs, get the time since the issue was marked In Progress
        if not last_mark:
            last_mark = self.get_datetime_issue_in_progress(issue)

        if last_mark:
            now = datetime.datetime.now(dateutil.tz.tzlocal())
            delta = now - last_mark
            minutes = int(utils.timedelta_total_seconds(delta) / 60)
            if minutes > 0:
                return str(minutes) + 'm'
            else:
                return None
1095342
def getNextTimeout(self):
        
        timeval = libusb1.timeval()
        result = libusb1.libusb_get_next_timeout(
            self.__context_p, byref(timeval))
        if result == 0:
            return None
        elif result == 1:
            return timeval.tv_sec + (timeval.tv_usec * 0.000001)
        raiseUSBError(result)
988585
def getChargeTimeElapsed(self):
    """"""
    command = '$GS'
    status = self.sendCommand(command)
    if int(status[1]) == 3:
      return int(status[2])
    else:
      return 0
439216
def get_current_time(self):
        
        current_time = c_double()
        self.library.get_current_time.argtypes = [POINTER(c_double)]
        self.library.get_current_time.restype = None
        self.library.get_current_time(byref(current_time))
        return current_time.value
465161
def __period_remaining(self):
        '''
        
        '''
        elapsed = self.clock() - self.last_reset
        return self.period - elapsed
1232012
def elapsed_time(self):
        """"""

        # Timer is running
        if self._t0 is not None:
            return self._time + self._get_time()
        else:
            return self._time
105879
protected long executeTimers()
    {
        assert (Thread.currentThread() == worker);

        changed = false;

        //  Fast track.
        if (timers.isEmpty()) {
            return 0L;
        }

        //  Get the current time.
        long current = clock();

        //   Execute the timers that are already due.
        for (Entry<TimerInfo, Long> entry : timers.entries()) {
            final TimerInfo timerInfo = entry.getKey();
            if (timerInfo.cancelled) {
                timers.remove(entry.getValue(), timerInfo);
                continue;
            }
            //  If we have to wait to execute the item, same will be true about
            //  all the following items (multimap is sorted). Thus we can stop
            //  checking the subsequent timers and return the time to wait for
            //  the next timer (at least 1ms).

            final Long key = entry.getValue();

            if (key > current) {
                return key - current;
            }

            //  Remove it from the list of active timers.
            timers.remove(key, timerInfo);

            //  Trigger the timer.
            timerInfo.sink.timerEvent(timerInfo.id);
        }

        //  Remove empty list object
        for (Entry<TimerInfo, Long> entry : timers.entries()) {
            final Long key = entry.getValue();

            if (!timers.hasValues(key)) {
                timers.remove(key);
            }
        }

        if (changed) {
            return executeTimers();
        }
        //  There are no more timers.
        return 0L;
    }
918744
protected Duration getNextTimeoutInterval() {
    Duration nextTimeoutInterval = INFINITE_FUTURE;
    if (!timers.isEmpty()) {
      // The time recorded in timer is in nano-seconds. We have to convert it to milli-seconds
      // We need to ceil the result to avoid early wake up
      nextTimeoutInterval = timers.peek().expirationTime.minusNanos(System.nanoTime());
    }
    return nextTimeoutInterval;
  }
452759
def _get_minutes_from_last_update(self, time):
        
        time_from_last_update = time - self.last_update_time
        return int(time_from_last_update.total_seconds() / 60)
1007213
@SuppressWarnings({"unused", "WeakerAccess"})
    public int getTimeElapsed() {
        int currentSession = getCurrentSession();
        if (currentSession == 0) return -1;

        int now = (int) (System.currentTimeMillis() / 1000);
        return now - currentSession;
    }
90730
def _get_minutes(self, duration):
        
        if isinstance(duration, datetime.datetime):
            from_now = (duration - datetime.datetime.now()).total_seconds()
            from_now = math.ceil(from_now / 60)

            if from_now > 0:
                return from_now

            return

        return duration
285543
def get(cls, name):
        
        if name in cls.timer_end:
            cls.timer_elapsed[name] = cls.timer_end[name] - \
                                      cls.timer_start[name]
            return cls.timer_elapsed[name]
        else:
            return "undefined"
247255
def active_time(self):
        
        if self._active_event.is_set():
            return self.pin_factory.ticks_diff(self.pin_factory.ticks(),
                                               self._last_changed)
        else:
            return None
204900
function isNearToCurrentTime (seconds) {
        var currentTime = getCurrentTime();
        var targetTime = getClampedTime(seconds);
        return Math.abs(currentTime - targetTime) <= CURRENT_TIME_TOLERANCE;
      }