One timer for each timed action, or one centralized method, on a t

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a GUI which is monitoring a real-time device. I have several timed
actions, such as periodic polling of the device, and indicators which flash
for a fixed period.

My first implementation of this was to replicate the way I have seen this
done before - have one central timed method, which is on a timer tick, and
use time variables to keep track of when events are due.

I have now realized that I can avoid the timer method, and time variables,
by having one timer for each timed action.

Using one timer for each timed action seems to be a simpler, and more
robust, solution, but I am reluctant to do this, for a couple of reasons -
one, the ticked method is a central point for all timed actions (which may or
may not be a good thing), and, two, this is what I'm used too.

Any opinions?

TIA,

Javaman
 
Why can't you use threads to monitor each device? AFAIK it will be simpler,
a information obtained from the device will be uptodate...
 
Hi Vadym,

I have to disagree. I think that, in general, a timer is a simpler solution
than a thread, but they are not as flexible. The problem with timers is that
they are not good for reading from a connection, and for actions which
require fine timing. However, the timer solution can become more complex than
a thread if we try to do to much with it.

Thanks,

Stephen
 
Back
Top