Set next cycle update time synced to nearest second or 0.1 of second.
495750
def _set_cycle_time(self):
        
        now = time()
        try:
            cycle_time = now - self._cycle_time
            if cycle_time < 0:
                cycle_time = 0
        except AttributeError:
            cycle_time = 0
        cycle_time += self.cycle_time
        if cycle_time == int(cycle_time):
            self._cycle_time = math.ceil(now + cycle_time)
        else:
            self._cycle_time = math.ceil((now + cycle_time) * 10) / 10
        self._cycle_time = now + self.cycle_time
1029350
def update(self, pbar):
        """"""

        if pbar.seconds_elapsed < 2e-6 or pbar.currval < 2e-6:
            scaled = bitmath.Byte()
        else:
            speed = pbar.currval / pbar.seconds_elapsed
            scaled = bitmath.Byte(speed).best_prefix(system=self.system)

        return scaled.format(self.format)
1175492
function nearestTimeFormat (value) {
  const keys = Object.keys(TimeFormats)
  for (let i = 0; i < keys.length; i++) {
    const next = TimeFormats[keys[i+1]]
    const current = TimeFormats[keys[i]]

    if (!next) return current.stringValue
    if (value > next.rawValue) continue

    return current.stringValue
  }
  return TimeFormats['ms'].stringValue
}
267220
def run(self):
        
        if self.update_time_value():
            self.i3status.py3_wrapper.notify_update(self.module_name)
        due_time = self.py3.time_in(sync_to=self.time_delta)

        self.i3status.py3_wrapper.timeout_queue_add(self, due_time)
418823
public void update(float f) {
        counter = (counter+1)%360;   // 1hour/10sec = 60mins/10sec=3600secs/10sec = 360
        sec10.update(f);
        if(counter%6==0)    min.update(f);
        if(counter==0)      hour.update(f);
    }
163966
def set_time_offset(self, offset, is_utc):
        """"""

        is_utc = bool(is_utc)
        self.clock_manager.time_offset = offset
        self.clock_manager.is_utc = is_utc

        return [Error.NO_ERROR]
396024
function() {
    var self = this
    self._shouldSyncFromOpts = true
    self.on('update', function() {
      if (self._shouldSyncFromOpts) self.trigger('sync')
      self._shouldSyncFromOpts = true
    })
  }
1239916
def _enough_time_has_passed(self, FPS):
    ''''''
    if FPS == 0:
      return False
    else:
      earliest_time = self.last_update_time + (1.0 / FPS)
      return time.time() >= earliest_time
503754
def _set_pseudotime(self):
        
        self.pseudotime = self.distances_dpt[self.iroot].copy()
        self.pseudotime /= np.max(self.pseudotime[self.pseudotime < np.inf])
166380
def update(self, pbar):
        """"""

        if pbar.seconds_elapsed < 2e-6 or pbar.currval < 2e-6: # =~ 0
            scaled = power = 0
        else:
            speed = pbar.currval / pbar.seconds_elapsed
            power = int(math.log(speed, 1000))
            scaled = speed / 1000.**power

        return self.FORMAT % (scaled, self.PREFIXES[power], self.unit)
379282
def set_redraw_lag(self, lag_sec):
        
        self.defer_redraw = (lag_sec > 0.0)
        if self.defer_redraw:
            self.defer_lagtime = lag_sec
424006
def set(self, timestamp, status, value):
        """"""
        received_timestamp = self._manager.time()
        reading = KATCPSensorReading(received_timestamp, timestamp, status, value)
        self._reading = reading
        self.call_listeners(reading)
281680
def next_run_in(self, utc_now=None):
        
        if utc_now is None:
            utc_now = datetime.utcnow()

        if self.is_alive():
            next_run = timedelta(seconds=self.interval_current) + self.activation_dt
            return next_run - utc_now
        else:
            return None
609172
protected void setTiming(boolean monitor, long t0, MessageToClient mtc) {
		if (monitor) {
			long t1 = System.currentTimeMillis();
			mtc.setTime(t1 - t0);
		}
	}
482902
def next_update(self, value):
        

        if not isinstance(value, datetime):
            raise TypeError(_pretty_message(
                '''
                next_update must be an instance of datetime.datetime, not %s
                ''',
                _type_name(value)
            ))

        self._next_update = value
1074295
def next(time, base)
      current = time
      until match?(current, base) && current > time
        pot_next = align(potential_next(current, base), base)
        pot_next += min_step if pot_next == current

        current = pot_next
      end

      current
    end
1196320
def _delay(self):
        """"""
        if not self.next_scheduled:
            self.next_scheduled = self.clock_func() + self.interval
            return
        while True:
            current = self.clock_func()
            if current >= self.next_scheduled:
                extratime = current - self.next_scheduled
                self.next_scheduled = current + self.interval - extratime
                return
            delay_amt = self.next_scheduled - current
            #Call for 0, because that might be meaningful to sleep_func.
            if self.allow_negative_sleep or delay_amt >= 0: 
                self.sleep_func(self.next_scheduled - current)