原文:線程池中的scheduleAtFixedRate scheduleWithFixedDelay區別

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

2014-10-29 08:58 0 2413 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM