Clock to be used by the cache as time reference.
352679
public final Cache2kBuilder<K, V> timeReference(TimeReference v) {
    config().setTimeReference(new CustomizationReferenceSupplier<TimeReference>(v));
    return this;
  }
38115
def update_clock(self, dt):
        
        dt = dt.astimezone(self.tzinfo)
        fmt = "%H:%M"
        if self.show_seconds:
            fmt = "%H:%M:%S"

        self.time_txt.text = dt.strftime(fmt)

        suppl_text = "{0} {1}".format(dt.strftime("%Y-%m-%d"), self.timezone)
        self.suppl_txt.text = suppl_text

        self.viewer.redraw(whence=3)
1300623
def next_time(self, asc=False):
        
        _time = time.localtime(time.time() + self.next())

        if asc:
            return time.asctime(_time)

        return time.mktime(_time)
432917
private void set_time()
	{
		if (date == true)
		{		
			Date d = new Date();
			
			long nb_millisec = d.getTime();
	
			when.tv_sec = (int)(nb_millisec / 1000);
			when.tv_usec = (int)((nb_millisec - (when.tv_sec * 1000)) * 1000);
			when.tv_nsec = 0;
		}
	}
1359082
def sync_time(self):
        """"""
        now = time.localtime(time.time())
        self.remote(set_time, (now.tm_year, now.tm_mon, now.tm_mday, now.tm_wday + 1,
                               now.tm_hour, now.tm_min, now.tm_sec, 0))
        return now
256892
static function atTime($now, callable $callback)
    {
        // store time if already overridden
        if (Clock::isOverridden()) {
            $previousOverride = Clock::microtime();
        } else {
            $previousOverride = null;
        }

        try {
            // override time
            Clock::override($now);

            // invoke callback
            return $callback();
        } finally {
            // restore previous state
            if ($previousOverride === null) {
                // no previous override - resume
                Clock::resume();
            } else {
                // restore previous override
                Clock::override($previousOverride);
            }
        }
    }
729276
def cache(time=0, byUser=None):
    
    def real_decorator(function):
        function.pi_api_cache_time = time
        function.pi_api_cache_by_user = byUser
        return function
    return real_decorator
337581
def st_ctime(self):
        """"""
        ctime = self._st_ctime_ns / 1e9
        return ctime if self.use_float else int(ctime)
435002
def datetime(self):
        
        if 'dt_scale' not in self._cache.keys():
            self._cache['dt_scale'] = self._datetime - timedelta(seconds=self._offset)
        return self._cache['dt_scale']
129623
def request_time(self, req):
        """"""
        r = time.time()
        self._time_result.set_value(r)
        return ("ok", r)
325666
def cache(name, value, created_on)
      meter = Meter.new(name: name, value: value, created_on: created_on, created_at: Time.now)
      store(name, meter)
    end
860647
private OffsetTime with(LocalTime time, ZoneOffset offset) {
        if (this.time == time && this.offset.equals(offset)) {
            return this;
        }
        return new OffsetTime(time, offset);
    }
816653
public void clock() {
		// No operation if test bit is set.
		if (test != 0) {
			return;
		}

		int /* reg24 */accumulator_prev = accumulator;

		// Calculate new accumulator value;
		accumulator += freq;
		accumulator &= 0xffffff;

		// Check whether the MSB is set high. This is used for synchronization.
		msb_rising = !((accumulator_prev & 0x800000) != 0)
				&& ((accumulator & 0x800000) != 0);

		// Shift noise register once for each time accumulator bit 19 is set
		// high.
		if (!((accumulator_prev & 0x080000) != 0)
				&& ((accumulator & 0x080000) != 0)) {
			int /* reg24 */bit0 = ((shift_register >> 22) ^ (shift_register >> 17)) & 0x1;
			shift_register <<= 1;
			shift_register &= 0x7fffff;
			shift_register |= bit0;
		}
	}
1097151
def access_time(self):
    """"""
    if self._stat_info is None:
      return None

    timestamp = int(self._stat_info.st_atime)
    return dfdatetime_posix_time.PosixTime(timestamp=timestamp)
606013
def cache(self):
    """"""
    if not self._bucket_width or self._untrusted_time is None:
      raise ValueError('QueryCompute must be initialized with a bucket_width '
                       'and an untrusted_time in order to write to the cache.')

    now = datetime.datetime.now()
    untrusted_time = now - datetime.timedelta(seconds=self._untrusted_time)
    list(self._query_cache.compute_and_cache_missing_buckets(
        self._start_time,
        self._end_time,
        untrusted_time))
1189708
def time(self, t=None):
        """"""
        if t is None:
            return self._time
        self._time = t
        return self
1329466
def memorized_timedelta(seconds):
    ''''''
    try:
        return _timedelta_cache[seconds]
    except KeyError:
        delta = timedelta(seconds=seconds)
        _timedelta_cache[seconds] = delta
        return delta