使用多个计时器的 Java 应用程序
大家好,感谢您阅读本文。 我有一个应用程序,我想在其上使用多个计时器。 它会从指令列表中读取一些指令,并告诉您要做什么,跟踪每条指令的时间,并在计时器结束时通知您。指令可以包括其他指令并继续。 我将时间分配为:每条指令双分钟。
所以它应该像这样工作。
启动指令1 - 启动计时器1(
如果包含其他),启动指令1.1 - 启动计时器1.1
启动指令2 - 启动计时器2 .....等等..
每次计时器耗尽后应该通知我
我想获得有关如何执行此操作的建议.... 欢迎任何教程、示例、链接伪代码、示例代码。谢谢
Hi all and thanks for reading this.
i have an application and i want to use multiple timers on it.
it will read from a list of instructions some instructions and will tell you what to do, keeping track of time for each instruction's time and notifying you when timer is over. instruction can include other instructions and goes on.
i m passing the time as : double minutes to each instruction.
So it should work like this.
start instruction1 - start timer1
if it includes other, start instruction1.1 - start timer1.1
start instruction2 - start timer2 .....etc.etc..
every time a timer goes of it should notify me
i would like to get suggestions on how to do this....
any tutorials, examples, links pseudocode, sample code are welcome. Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
介绍 Java 语言的 Timer 类的简单概括
< a href="http://www.iam.ubc.ca/guides/javatut99/uiswing/misc/timer.html" rel="nofollow">如何使用计时器
使用计时器和 Quartz 进行作业调度
Introducing a simple generalisation of the Java language's Timer class
How to Use Timers
Job Scheduling using Timer and Quartz