Determine the next check cron time.

 @param check [Hash] definition.
320167
def determine_check_cron_time(check)
      cron_parser = CronParser.new(check[:cron])
      current_time = Time.now
      next_cron_time = cron_parser.next(current_time)
      next_cron_time - current_time
    end
845788
def kube_cronjob_next_schedule_time(self, metric, scraper_config):
        
        # Used as a service check so that one can be alerted if the cronjob's next schedule is in the past
        check_basename = scraper_config['namespace'] + '.cronjob.on_schedule_check'
        curr_time = int(time.time())
        for sample in metric.samples:
            on_schedule = int(sample[self.SAMPLE_VALUE]) - curr_time
            tags = [
                self._format_tag(label_name, label_value, scraper_config)
                for label_name, label_value in iteritems(sample[self.SAMPLE_LABELS])
            ]
            tags += scraper_config['custom_tags']
            if on_schedule < 0:
                message = "The service check scheduled at {} is {} seconds late".format(
                    time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(int(sample[self.SAMPLE_VALUE]))), on_schedule
                )
                self.service_check(check_basename, self.CRITICAL, tags=tags, message=message)
            else:
                self.service_check(check_basename, self.OK, tags=tags)
166480
def run(self):
        
        while not self.stopped:
            now = datetime.utcnow()
            for job in self.parent.jobs:
                if not job.next_run:
                    continue
                if job.next_run >= self.last_check and job.next_run <= now:
                    if job.state.allow_start:
                        job.start()
                    else:
                        job.next_run = job.cron_iter.get_next(datetime)
            self.last_checked = now
            time.sleep(1)
714346
def update(every, timezone: nil)
            time = Scheduler.parse_in(every, :quiet) || Scheduler.parse_cron(every, :quiet, timezone: timezone)
            raise ArgumentError.new("couldn't parse \"#{o}\"") if time.nil?

            @every = time
            reschedule
        end
1082832
def update(time)
            @last_scheduled = @reactor.now

            parsed_time = Scheduler.parse_in(time, :quiet)
            if parsed_time.nil?
                # Parse at will throw an error if time is invalid
                parsed_time = Scheduler.parse_at(time) - @scheduler.time_diff
            else
                parsed_time += @last_scheduled
            end

            @next_scheduled = parsed_time
            @scheduler.reschedule(self)
        end
192881
function(cronspec, sixth) {
    var schedule = later.parse.cron(cronspec, sixth);
    return scheduleToSentence(schedule['schedules'][0], sixth);
  }
916528
def _check_time_backwards(self):
        

        now = time.time()

        if now < self.start:
            self.start = now
            self.end = self.start + self.length
8432
def wait(i, &block)
      @order[i] = block
      return unless i == @current

      while order[@current]
        order.delete(@current).call
        @current += 1
      end
    end
383243
function(started_time) {

		var now = new Date().getTime();
		this._started_time = started_time || now;
		this._end_time = this._started_time + this._duration;

		if (now < this._end_time) {

			this._is_running = true;
			Lava.Cron.acceptTask(this);
			this.onTimer(now);

		} else {

			this.onTimer(this._end_time);

		}

	}
269584
def _check_delay(self):
        
        if self._previous_request_at:
            dif = round(time.time() - self._previous_request_at,
                        2) * 1000  # difference in miliseconds
            if dif < self.requests_delay:
                time.sleep(
                    (self.requests_delay - dif) / 1000)  # sleep needs seconds
        self._previous_request_at = time.time()
684649
def run time=nil

      puts "[cron] run called #{Time.now}" if @debug
      time = self.time if time.nil?
      self.each { |cron_job|
        ok,details = cron_job.runnable?(time)
        if ok then
          @queue.enq(cron_job)
          if cron_job.once? then
            cron_job[:delete] = true
          end
        end
      }
      self.reject! { |cron_job|
        cron_job[:delete]
      }
    end
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
956971
def next_time
      execution_time = SidekiqScheduler::RedisManager.get_job_next_time(name)

      relative_time(Time.parse(execution_time)) if execution_time
    end
585083
public void setCheckInterval(long checkInterval)
  {
    if (checkInterval < 0 || checkInterval > Long.MAX_VALUE / 2)
      _checkInterval = Long.MAX_VALUE / 2;
    else
      _checkInterval = checkInterval;

    _checkExpiresTime = 0;
  }
407609
protected function housekeeping_check()
	{
		if ((time() - $this->housekeeping_last_check) >= $this->housekeeping_check_interval)
		{
			// check to make sure no children are violating the max run time
			$this->kill_maxtime_violators();

			// look for zombie children just in case
			$this->signal_handler_sigchild(SIGCHLD);

			// update the last check time to now
			$this->housekeeping_last_check = time();
		}
	}
1055780
def delay(self):
        ''''''
        if self._last_checked:
            return self._interval - (time.time() - self._last_checked)
        return self._interval
427899
function nextTime(value, cronTime){
  if(typeof(cronTime) == 'number'){
    if(cronTime == -1)
      return value + 1;
    else
      return cronTime;
  }else if(typeof(cronTime) == 'array'){
    if(value < arr[0] || value > arr[arr.length -1])
      return arr[0];
    
    for(let i = 0; i < arr.length; i++)
      if(value < arr[i])
        return arr[i];
  }
  
  return null;
}