Tick the ticker.
        Return a tuple of values corresponding to periods given in initializer,
        each value representing the rate of ticks (number of ticks per second)
        during that period.
550827
def tick(self):
        """"""
        now = datetime.datetime.now()
        self.add(now)

        # Create a list of timestamps, one for each period and
        # representing the beginning of that period (i.e. since now.)
        tstamps = [now - datetime.timedelta(seconds=xx)
                   for xx in self._periods]

        # Trim off any tick values older than the earliest timestamp.
        self.removeLT(min(tstamps))

        # Create a list of counts, one for each period and
        # representing the number of ticks in that period.
        counts = [self.getCountGT(xx) for xx in tstamps]

        # Compute a list of rates for the periods.
        rates = [float(xx)/yy for xx, yy in zip(counts, self._periods)]

        # Return the rates as a tuple.
        return tuple(rates)
811145
def determine_ticks(low, high):
    """"""
    
    range_ = high - low
    tick_difference = 10 ** math.floor(math.log10(range_ / 1.25))
    low_tick = math.floor(low / tick_difference) * tick_difference
    ticks = [low_tick + tick_difference] if low_tick < low else [low_tick]
    while ticks[-1] + tick_difference <= high:
        ticks.append(ticks[-1] + tick_difference)
    return tuple(ticks)
746141
def _tile_ticks(self, frac, tickvec):
        """"""
        origins = np.tile(self.axis._vec, (len(frac), 1))
        origins = self.axis.pos[0].T + (origins.T*frac).T
        endpoints = tickvec + origins
        return origins, endpoints
478064
public void tick() {
        final long count = uncounted.sumThenReset();
        final double instantRate = count / interval;
        if (initialized) {
            rate += (alpha * (instantRate - rate));
        } else {
            rate = instantRate;
            initialized = true;
        }
    }
1236838
def _get_ticks(self, opts):
        
        opts, _ = self._get_opts(opts, None)
        if "xticks" not in opts:
            if "xticks" not in self.chart_opts:
                self.err(self.dlinear_,
                         "Please set the xticks option for this chart to work")
                return
            else:
                xticks = self.chart_opts["xticks"]
        else:
            xticks = opts["xticks"]
        if "yticks" not in opts:
            if "yticks"not in self.chart_opts:
                self.err(self.dlinear_,
                         "Please set the yticks option for this chart to work")
                return
            else:
                yticks = self.chart_opts["yticks"]
        else:
            yticks = opts["yticks"]
        return xticks, yticks
1292436
def draw_ticks(self):
        """"""
        self._canvas_ticks.create_line((0, 10, self.pixel_width, 10), fill="black")
        self._ticks = list(TimeLine.range(self._start, self._finish, self._tick_resolution / self._zoom_factor))
        for tick in self._ticks:
            string = TimeLine.get_time_string(tick, self._unit)
            x = self.get_time_position(tick)
            x_tick = x + 1 if x == 0 else (x - 1 if x == self.pixel_width else x)
            x_text = x + 15 if x - 15 <= 0 else (x - 15 if x + 15 >= self.pixel_width else x)
            self._canvas_ticks.create_text((x_text, 20), text=string, fill="black", font=("default", 10))
            self._canvas_ticks.create_line((x_tick, 5, x_tick, 15), fill="black")
        self._canvas_ticks.config(scrollregion="0 0 {0} {1}".format(self.pixel_width, 30))
1277082
private void tick(long tickIntervalMs) {
        for (int i = 0; i < NUM_AVERAGES; ++i) {
            stat[i].tick(tickIntervalMs);
        }
    }
842704
def countdown_timer(seconds=10):
    

    tick = 0.1  # seconds
    n_ticks = int(seconds / tick)

    widgets = ['Pause for panic: ', progressbar.ETA(), ' ', progressbar.Bar()]
    pbar = progressbar.ProgressBar(
        widgets=widgets, max_value=n_ticks
    ).start()

    for i in range(n_ticks):
        pbar.update(i)
        sleep(tick)

    pbar.finish()
218348
function tick (a) {
			if (isStopped) return;

			let playedTime = context.currentTime - initTime;
			let playedCount = playedTime * sampleRate;

			//if offset has changed - notify processor to provide a new piece of data
			if (lastCount - playedCount < samplesPerFrame) {
				//send queued data chunk to buffer
				util.copy(shift(samplesPerFrame), buffer, lastCount % buffer.length)

				//increase rendered count
				lastCount += samplesPerFrame;

				//if there is a holding pressure control - release it
				if (release) {
					let cb = release;
					release = null;
					cb()
				}

				//call tick extra-time in case if there is a room for buffer
				//it will plan timeout, if none
				tick()
			}
			//else plan tick for the expected time of starving
			else {
				//time of starving is when played time reaches (last count time) - half-duration
				let starvingTime = (lastCount - samplesPerFrame) / sampleRate;
				let remainingTime = starvingTime - playedTime;
				setTimeout(tick, remainingTime * 1000)
			}
		}
270971
def tick_clients(self):
        """"""
        if not self._ticker:
            self._create_ticker()

        for client in self.clients.values():
            self._ticker.tick(client)
169190
def pulse(time, start, duration):
    
    t = time()
    return 1 if start <= t < start + duration else 0
1100790
function CountingClock() {
  var self = this, at, mark = null;

  self.at = function() {
    return at;
  };

  self.init = function() {
    at = mark = 0;
    return at;
  };

  self.inc = function() {
    at += 1;
  };

  self.tick = function() {
    if (mark === null) {
      mark = at + 1;
    }

    return ((at - mark) >= 1);
  };

  self.tock = function(elapsed) {
    var d = at - elapsed;
    if ( d >= 1) {
      mark += 1;
      return true;
    }
    return false;
  };
}
1241695
def get_time_rate(self):
        '''
        
        '''
        if isinstance(self.__time_rate, float) is False:
            raise TypeError("The type of __time_rate must be float.")

        if self.__time_rate <= 0.0:
            raise ValueError("The value of __time_rate must be greater than 0.0")

        return self.__time_rate
185745
def GetFrequencyStartTimes(self):
    """"""
    start_times = []
    # for each headway period of the trip
    for freq_tuple in self.GetFrequencyTuples():
      (start_secs, end_secs, headway_secs) = freq_tuple[0:3]
      # reset run secs to the start of the timeframe
      run_secs = start_secs
      while run_secs < end_secs:
        start_times.append(run_secs)
        # increment current run secs by headway secs
        run_secs += headway_secs
    return start_times
245889
function(callback, duration){
        var that = this;
        var targetTime = new Date().getTime() + duration;
        var tickObj = {
            tick:function(){
                var nowTime = new Date().getTime();
                var dt = nowTime - targetTime;
                if(dt >= 0){
                    if(dt < duration){
                        nowTime -= dt;
                    }
                    targetTime = nowTime + duration;
                    callback();
                }
            }
        };
        that.addTick(tickObj);
        return tickObj;
    }
880561
def value(self, t):
        """"""
        fraction = min(float(t) / max(1, self.schedule_timesteps), 1.0)
        return self.initial_p + fraction * (self.final_p - self.initial_p)
878032
def parse_period(self, period_str):
        
        period = period_str.translate(TRANSLATION_MAP)[3:14].strip()
        return float(period) if period else None