lamrongol
@lamrongol (Lamron)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

【Java】TimerクラスとScheduledExecutorServiceどちらでスケジュール処理をした方がパフォーマンスが良いでしょう?

解決したいこと

Javaでスケジュール処理をする場合、Timer以外にScheduledExecutorServiceを使用する方法がある事を最近知ったのですが、この二つは「パフォーマンス」の面で違いがあるのでしょうか?
以下のページを見るとScheduledExecutorServiceのメリットとして「効率的なスレッド管理」等が挙げられてますが、Java 21での新しいスレッド処理などで違いが生じたりするでしょうか?
Javaでのスレッドを用いたタイマーとスケジュールタスクの効果的な実装方法 | IT trip

参考: Java21のVirtualThreadsに対する自分の理解 #SpringBoot - Qiita

0

No Answers yet.

Your answer might help someone💌