What is the system effect of starting a large number of timers in Java?

Recently, I had to program some applications that require a large number of scheduled tasks. However, I am afraid to create so many timers because I could not understand how they are handled by Java. Is there a problem with starting a large number of scheduled tasks? If so, which alternative is better?

+3
source share
2 answers

If you mean one timer and many tasks, Javadocs for Timersays:

: ( ). , O (log n), n - .

, , . , java.util.concurrent.ScheduledThreadPoolExecutor.

+3

, . :

:

+1

Source: https://habr.com/ru/post/1712579/


All Articles