from datetime import datetime from apscheduler.schedulers.blocking import BlockingScheduler def tick(): print(datetime.now()) if __name__ == '__main__': scheduler = BlockingScheduler() scheduler.add_job(tick, 'interval', seconds=1.0000000) scheduler.start()