from pycron import CronScheduler if __name__ == "__main__": scheduler = CronScheduler() counter = {"count": 0} scheduler.add_interval_job(0.05, lambda: counter.__setitem__("count", counter["count"] + 1)) scheduler.start() scheduler.stop() print(f"executions={counter['count']}")