原文:(原創)定時線程池中scheduleWithFixedDelay和scheduleAtFixedRate的區別

scheduleAtFixedRate 沒有什么歧義,很容易理解,就是每隔多少時間,固定執行任務。 scheduleWithFixedDelay 比較容易有歧義 貌似也是推遲一段時間執行任務,但Oracle的解釋如下,delay的意思是當結束前一個執行后延遲的時間 scheduleWithFixedDelayParameters: command the task to execute initi ...

2015-12-01 15:48 0 27362 推薦指數:

查看詳情

線程池中scheduleAtFixedRate scheduleWithFixedDelay區別

在調度線程池中有這么兩個方法,到底什么區別呢,且看我解釋: scheduleAtFixedRate :這個是按照固定的時間來執行,簡單來說:到點執行scheduleWithFixedDelay:這個呢,是等上一個任務結束后,在等固定的時間,然后執行。簡單來說:執行完上一個任務后再執行 ...

Wed Oct 29 16:58:00 CST 2014 0 2413
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM