Create a repeating event that occurs each time period

 @param time [String] a human readable string representing the time period. 3w2d4h1m2s for example.
 @param callback [Proc] a block or method to execute when the event triggers
 @return [::UV::Repeat]
960077
def every(time)
            ms = Scheduler.parse_in(time)
            event = Repeat.new(self, ms)
            event.progress &Proc.new if block_given?
            schedule(event)
            event
        end
783687
def _timesheets_callback(self, callback):
        
        def call(*args, **kwargs):
            return_values = []

            for timesheet in self:
                attr = getattr(timesheet, callback)

                if callable(attr):
                    result = attr(*args, **kwargs)
                else:
                    result = attr

                return_values.append(result)

            return return_values

        return call
713210
def occurrence_at( time )
      real_duration = duration - 1

      range = [ time - real_duration, time ]

      start_time = proxy.occurrences_between( range[0], range[1] ).first
      end_time   = start_time + real_duration

      Occurrence.new start_time, real_duration, end_time
    end
723971
def func_runtime(callback):
    
    now = time.time()
    print('%s - start: %f' % (callback, now))
    callback()
    now = time.time() - now
    print('%s - spent: %f Second' % (callback, now))
686513
function makeRequestCallFromTimer(callback) {
    return function requestCall() {
        // We dispatch a timeout with a specified delay of 0 for engines that
        // can reliably accommodate that request. This will usually be snapped
        // to a 4 milisecond delay, but once we're flushing, there's no delay
        // between events.
        var timeoutHandle = setTimeout(handleTimer, 0);
        // However, since this timer gets frequently dropped in Firefox
        // workers, we enlist an interval handle that will try to fire
        // an event 20 times per second until it succeeds.
        var intervalHandle = setInterval(handleTimer, 50);

        function handleTimer() {
            // Whichever timer succeeds will cancel both timers and
            // execute the callback.
            clearTimeout(timeoutHandle);
            clearInterval(intervalHandle);
            callback();
        }
    };
}
1143501
def once(self, event, callback):
        ''
        self._once_events.add(event)
        self.on(event, callback)
843853
function createLinkedTimelines() {
    const tl1 = createTimeline();
    const tl2 = createTimeline();
    tl1.setNeighbouringTimeline(tl2, EventTimeline.FORWARDS);
    tl2.setNeighbouringTimeline(tl1, EventTimeline.BACKWARDS);
    return [tl1, tl2];
}
1010186
function(clock, deadline, func) {
  this.clock = clock
  this.func = func
  this._cleared = false // Flag used to clear an event inside callback

  this.toleranceLate = clock.toleranceLate
  this.toleranceEarly = clock.toleranceEarly
  this._latestTime = null
  this._earliestTime = null
  this.deadline = null
  this.repeatTime = null

  this.schedule(deadline)
}
1306942
def start_time
      @start_time ||= @events.select { |event|
        event.is_a?(RequestWillBeSent)
      }.select { |event|
        event.request['url'] == @url
      }.map { |event|
        event.timestamp
      }.first
    end
1368585
static String repeat(final String toBeRepeated, final int numTimes) {
        final StringBuilder builder = new StringBuilder();

        for (int i = 0; i < numTimes; i++) {
            builder.append(toBeRepeated);
        }
        return builder.toString();
    }
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;
    }
149154
async def repeat(ctx, times: int, content='repeating...'):
    """"""
    for i in range(times):
        await ctx.send(content)
1076893
def rangify_time_boundaries(src)
      src.split("..").inject{ |s,e| s.split(".").inject{|n,m| n.to_i.send(m)}..e.split(".").inject{|n,m| n.to_i.send(m) }}
    end
901410
function (timestamp) {
        var time = (new Date(timestamp)).toISOString();
        return {
            msg       : time,
            msgLength : time.length
        };
    }
1049064
def start(self, *args, **kwargs):
        

        @wraps(self.callback)
        def callback():
            os.read(self.timer, 8)
            repeat = self.callback(*args, **kwargs)
            if not repeat:
                self.stop()

        spec = timerfd.itimerspec(self.interval, self.interval)
        timerfd.settime(self.timer, 0, spec)

        self.loop.remove_watcher(self.timer)
        self.loop.add_watcher(self.timer, callback)
989569
def periodic(self, period_seconds, callback):
        
        priority = 0

        def caller(scheduled_deadline):
            # Event MUST be re-registered first in order to ensure that it can be cancelled from the callback
            scheduled_deadline += period_seconds
            event_holder[0] = self._scheduler.enterabs(scheduled_deadline, priority, caller, (scheduled_deadline,))
            callback()

        first_deadline = self._scheduler.timefunc() + period_seconds
        event_holder = [self._scheduler.enterabs(first_deadline, priority, caller, (first_deadline,))]
        return self._make_sched_handle(lambda: event_holder[0])
805566
function make_event(event, target) {
  return string_p(event)?  Event.make(event, target)
  :      /* otherwise */   event }