TeaTimer - a simple application to demonstrate accurate timing
This application shows how to implement a clock using deadlines. If you don't have an RTC or similar time counting device it is nearly impossible to design an application with accurate timing or equidistant time steps with a standard JAVA™ environment. You can do a
Using JControl deadlines you can specify that counting a second takes exacly one second, it is up to the virtual machine to guarantee this timing.
After startup you can set the brewing time using up/down (defaults to 3 mins), after pressing select the clock starts ticking. If the selected time span expires the buzzer beeps a couple of times, pressing a key aborts beeping and the program starts again but with the duration selected before. It is possible to break the count-down holding the "up" key.