@Override
        public void run() {
            long currentTimestamp = System.currentTimeMillis();
            synchronized (TimestampGeneratorImpl.this) {
                heartbeatRunning = false;
                long diff = currentTimestamp - lastSystemTimestamp;
                if (diff >= idleTime) {
                    // Siddhi has not received events for more than idleTime
                    long newTimestamp = lastEventTimestamp + incrementInMilliseconds;
                    setCurrentTimestamp(newTimestamp);
                } else {
                    // Wait for idleTime from the timestamp if last event arrival
                    notifyAfter(idleTime - diff);
                }
            }
        }
This {@link Runnable} class is executed by the {@link ScheduledExecutorService}
modules/siddhi-core/src/main/java/io/siddhi/core/util/timestamp/TimestampGeneratorImpl.java