Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python equivalent of Java Timer java.util.Timer

Java SE has a scalable Timer object that, using one single thread, allows large numbers of concurrently scheduled tasks (thousands should present no problem). It internally uses a binary heap to represent its task queue.

Is there a Python equivalent? Standard or in a very popular library is preferable.

like image 840
necromancer Avatar asked Oct 03 '22 07:10

necromancer


1 Answers

Yes, have a look at the sched module. It utilizes binary heap (from heapq) as well.

like image 96
rkhayrov Avatar answered Oct 07 '22 19:10

rkhayrov