开发者

java thread - how to have a thread that runs each second, and prefferably, in that thread have it do 1 action each 5 seconds?

I have a thread that runs each second with开发者_运维技巧 the sleep command. this works fine, but I'd like to have it do certain actions every 5 seconds too. Both things should run at the same time.. I've had problems starting a second thread in a first one...

any help please?

Thanks in advance!


See http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ScheduledExecutorService.html.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜