I have code where I schedule a task using java.util.Timer
. I was looking around and saw ExecutorService
can do the same. So this question here, have you used Timer
and ExecutorService
to schedule tasks, what is the benefit of one using over another?
Also wanted to check if anyone had used the Timer
class and ran into any issues which the ExecutorService
solved for them.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…