private void sendTimerEvents(SchedulerState state) {
        Long toNotifyTime = state.toNotifyQueue.peek();
        long currentTime = siddhiQueryContext.getSiddhiAppContext().getTimestampGenerator().currentTime();
        while (toNotifyTime != null && toNotifyTime - currentTime <= 0) {
            state.toNotifyQueue.poll();
            StreamEvent timerEvent = streamEventFactory.newInstance();
            timerEvent.setType(StreamEvent.Type.TIMER);
            timerEvent.setTimestamp(toNotifyTime);
            if (lockWrapper != null) {
                lockWrapper.lock();
            }
            threadBarrier.enter();
            try {
                ComplexEventChunk<StreamEvent> streamEventChunk = new ComplexEventChunk<>();
                streamEventChunk.add(timerEvent);
                if (Level.BASIC.compareTo(siddhiQueryContext.getSiddhiAppContext().getRootMetricsLevel()) <= 0 &&
                        latencyTracker != null) {
                    try {
                        latencyTracker.markIn();
                        singleThreadEntryValve.process(streamEventChunk);
                    } finally {
                        latencyTracker.markOut();
                    }
                } else {
                    singleThreadEntryValve.process(streamEventChunk);
                }
            } catch (Throwable t) {
                log.error("Error while sending timer events, " + t.getMessage(), t);
            } finally {
                if (lockWrapper != null) {
                    lockWrapper.unlock();
                }
                threadBarrier.exit();
            }

            toNotifyTime = state.toNotifyQueue.peek();
            currentTime = siddhiQueryContext.getSiddhiAppContext().getTimestampGenerator().currentTime();
        }
    }
Go through the timestamps stored in the toNotifyQueue and send the TIMER events for the expired events.

@param state current state
modules/siddhi-core/src/main/java/io/siddhi/core/util/Scheduler.java