473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
2 1609
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tamim | last post by:
Hi I've build a library dll using VS.NET C#, i needed to do an internal timed operation when my dll is referenced in other applications so i've used server components System.Timers.Timer, i've...
2
by: Benjamin | last post by:
Hi, I am having a problem enabling a timer in my class. I have attached some sample pseudo code (see "Sample code illustrating issue") so you can see what I am talking about. Whats the issue?...
9
by: HL | last post by:
I am using VS 2005 Beta - C# Problem: The Timer fires a few milliseconds before the actual Due-Time Let's say a timer is created in the following manner: System.Threading.Timer m_timer = null;...
10
by: Ryan | last post by:
Hello everyone, I have made a service that starts timers when it starts. I have another windows form application that stops and starts the service. Do I need to deal with any started timers when...
4
by: sophistiKate | last post by:
I am working with an Access 2003 database. Since adding a timer event to check for idle time to a form, a custom toolbar button that creates a snapshot has stopped working properly. Until the first...
5
by: Joe C. | last post by:
hello, thanks for reading. this topic was probably covered in the past; if so, i apologize for the repost, and would you kindly redirect me to the topic? i have small app that monitors the...
9
by: eljainc | last post by:
Hello, I'm having a problem with a simple application that I've written. I have a form that loads another form. The second form has a timer control on it. The timer will not fire for some...
7
by: ssecorp | last post by:
I am not clear about the results here. from timeit import Timer import Decorators def fib(n): a, b = 1, 0 while n: a, b, n = b, a+b, n-1
1
by: Prof. William Battersea | last post by:
I'd like a class method to fire every n seconds. I tried this: class Timed: def.__init__(self): self.t = Timer(3, self.dothing) def.start(self): self.t.start()
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.