Schedules the given timeout handler for the given instance.

@param timeoutHandler the handler
@param scheduledFor the instance in time
@return the timer
357977
public static Timer schedule(
            TimeoutHandler timeoutHandler, Instant scheduledFor) {
        return scheduler.schedule(timeoutHandler, scheduledFor);
    }
2174
public Timer newTimer(String opType, int sampleCount)
    {
        final Timer timer = new Timer(sampleCount);

        if (!timers.containsKey(opType))
            timers.put(opType, new ArrayList<Timer>());

        timers.get(opType).add(timer);
        return timer;
    }
241935
public SdkClientBuilder connectionCheckoutTimeout(long timeout, TimeUnit unit)
    {
        this.connectionCheckoutTimeoutMs = (int) TimeUnit.MILLISECONDS.convert(timeout, unit);
        return this;
    }
1289015
@Override
    protected PersistentTimer createTimer(EJBRuntime ejbRuntime) {
        return ejbRuntime.getPersistentTimer(TaskIdAccessor.get(), j2eeName, this);
    }
1321183
public static <K, V> TimedCache<K, V> newTimedCache(long timeout){
		return new TimedCache<K, V>(timeout);
	}
991131
@Override
  public void onTimer(String timerName) {
    if (timerName.equals(IDLE_SESSION_TIMER_NAME)) {
      checkIdleAppSession();
    }
    else if (timerName.equals(TCC_TIMER_NAME)) {
      new TccScheduledTask(this).run();
    }
    else {
      logger.warn("Received an unknown timer '{}' for Session-ID '{}'", timerName, getSessionId());
    }
  }
37073
def setTimer(self, timeout, description=None):
        
        self.timerId += 1
        timer = Timer(timeout, self.__timeoutHandler, (self.timerId, description))
        timer.start()
        self.timers[self.timerId] = timer
        return self.timerId
1076386
public static function timer(int $dueTime, AsyncSchedulerInterface $scheduler = null): TimerObservable
    {
        return new TimerObservable($dueTime, $scheduler ?: Scheduler::getAsync());
    }
712826
public static Timer timer(Metrics metrics, String component, String methodName) {
    if (metrics != null) {
      return metrics.getTimer(component, methodName);
    } else {
      return null;
    }
  }
1211938
public static Timer newTimer(String name, TimeUnit unit) {
    return new BasicTimer(MonitorConfig.builder(name).build(), unit);
  }
908426
@Nonnull
    private Timer getTimer() {
        return timerReference.updateAndGet(timer -> timer == null ? new Timer(LogConfigurationTask.class.getSimpleName(), true) : timer);
    }
690523
public static ScheduledEventService getScheduleService() {
        CHFWBundle c = instance.get().get();
        if (null != c) {
            return c.scheduler;
        }
        return null;
    }
844361
public static Scheduler createScheduler(int threadPoolSize, String annotatedJobsPackageName)
      throws SundialSchedulerException {

    if (scheduler == null) {
      try {
        scheduler = new SchedulerFactory().getScheduler(threadPoolSize, annotatedJobsPackageName);

      } catch (SchedulerException e) {
        throw new SundialSchedulerException("COULD NOT CREATE SUNDIAL SCHEDULER!!!", e);
      }
    }
    return scheduler;
  }
783298
@Override
  public void onTimer(String timerName) {
    if (timerName.equals(IDLE_SESSION_TIMER_NAME)) {
      checkIdleAppSession();
    }
    else if (timerName.equals(TX_TIMER_NAME)) {
      new TxTimerTask(this, sessionData.getTxTimerRequest()).run();
    }
    else {
      logger.warn("Received an unknown timer '{}' for Session-ID '{}'", timerName, getSessionId());
    }
  }
988013
public ConverterServerBuilder requestTimeout(long timeout, TimeUnit unit) {
        assertNumericArgument(timeout, true);
        this.requestTimeout = unit.toMillis(timeout);
        return this;
    }
1219038
public boolean setTimerEnabled(VacuumTimer timer) throws CommandExecutionException {
        if (timer == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
        JSONArray payload = new JSONArray();
        payload.put(timer.getID());
        payload.put(timer.getOnOff());
        return sendOk("upd_timer", payload);
    }
611773
public Trigger getCronTrigger(String cronExpression) {
    CronScheduleBuilder cronScheduleBuilder = null;
    Trigger cronTrigger = null;
    try {
      cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
      cronScheduleBuilder.withMisfireHandlingInstructionFireAndProceed();
      TriggerBuilder<Trigger> cronTtriggerBuilder = TriggerBuilder.newTrigger();
      cronTtriggerBuilder.withSchedule(cronScheduleBuilder);
      cronTrigger = cronTtriggerBuilder.build();
    } catch (Exception pe) {
      logger.error("Error occurred while builiding the cronTrigger : " + pe.getMessage(), pe);
    }
    return cronTrigger;
  }