By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,616 Members | 1,184 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,616 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Why can't you use threads to monitor each device? AFAIK it will be simpler,
a information obtained from the device will be uptodate...

--
Vadym Stetsyak aka Vadmyst

"Javaman59" <Ja*******@discussions.microsoft.com> wrote in message
news:DD**********************************@microsof t.com...
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

Nov 17 '05 #2

P: n/a
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

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

--
Vadym Stetsyak aka Vadmyst

"Javaman59" <Ja*******@discussions.microsoft.com> wrote in message
news:DD**********************************@microsof t.com...
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


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.