How to write a Timer program in java
-
Hi Friends, I would like to know , how to write a timer program.For eg the application should trigger after a particular time.Thanks in Advance :)
-
Hi Friends, I would like to know , how to write a timer program.For eg the application should trigger after a particular time.Thanks in Advance :)
VickyVicki wrote:
the application should trigger after a particular time.
Trigger what? Do you mean that it should run doing nothing until a certain time of day or until a certain time interval has elapsed? In either case a quick look at the Java documentation for something to do with Date[^]s or times should help.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
Hi Friends, I would like to know , how to write a timer program.For eg the application should trigger after a particular time.Thanks in Advance :)
Don't believe Richard, for him time is something that is flying by :laugh: ;P GregorianCalendar [^]is so much better! Combine it with This one about running System Commands[^]. The rest is up to you - that is what development is about. Make a plan, write things down, sketch a GUI and afterwards start implementing what you've written down.
regards Torsten When I'm not working
-
Hi Friends, I would like to know , how to write a timer program.For eg the application should trigger after a particular time.Thanks in Advance :)
Well, you could use the Java Timer class: http://docs.oracle.com/javase/6/docs/api/java/util/Timer.html[^] Or if your requirements are more complicated, try something like Quartz: http://quartz-scheduler.org/[^]
-
Don't believe Richard, for him time is something that is flying by :laugh: ;P GregorianCalendar [^]is so much better! Combine it with This one about running System Commands[^]. The rest is up to you - that is what development is about. Make a plan, write things down, sketch a GUI and afterwards start implementing what you've written down.
regards Torsten When I'm not working
TorstenH. wrote:
time is something that is flying by
Faster every year! :((
TorstenH. wrote:
GregorianCalendar
I can never remember this class, even though it's obvious.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
Well, you could use the Java Timer class: http://docs.oracle.com/javase/6/docs/api/java/util/Timer.html[^] Or if your requirements are more complicated, try something like Quartz: http://quartz-scheduler.org/[^]
Thanks for all your replies. :) I wanted something like an quiz system .After the particular time getsover the application should stop and also should start after a specific min
-
Thanks for all your replies. :) I wanted something like an quiz system .After the particular time getsover the application should stop and also should start after a specific min
If you need to measure an elapsed time, a simple
Thread
with asleep
orwait
in it may be sufficient.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
-
TorstenH. wrote:
time is something that is flying by
Faster every year! :((
TorstenH. wrote:
GregorianCalendar
I can never remember this class, even though it's obvious.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
Richard MacCutchan wrote:
Faster every year
As they sang in Trumpton[^]: [sing] Time flies by when you're a driver of a train, Speeding out of Trumpton with a cargo of cocaine. I get high when im a pilot of a plane. Touching down in Camberwick, I'm stoned out of my brain. [/sing]
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
-
Richard MacCutchan wrote:
Faster every year
As they sang in Trumpton[^]: [sing] Time flies by when you're a driver of a train, Speeding out of Trumpton with a cargo of cocaine. I get high when im a pilot of a plane. Touching down in Camberwick, I'm stoned out of my brain. [/sing]
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
I never really watched Trumpton, but my children used to love it.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman