473,626 Members | 3,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1627
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*******@disc ussions.microso ft.com> wrote in message
news:DD******** *************** ***********@mic rosoft.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*******@disc ussions.microso ft.com> wrote in message
news:DD******** *************** ***********@mic rosoft.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
1377
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 declared it as private member to my class, its enabled inside a method with certain logi I've tested the dll in a sample application and i've had a major problem which is the application is not terminated from memory when i close the application and...
2
1717
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? ================ I am unable to pause the timer when a timed event is thrown due to my event handling having a private scope. If I make the scope public all works as expected.
9
7264
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; Let's declare a constant Int32 m_TimePeriod = 10000;
10
1935
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 the service stops? Being new at this service stuff, I don't know if it holds state or memory and I need to stop all active timers or if the magical gc will come along and help out. Thanks, I hope that makes sense.
4
2371
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 time the timer event procedure is run, the button works fine, but after that, it produces an error "The Object Type argument for the action or method is blank or invalid." The button runs a macro which runs the action "OutputTo" with the following...
5
1595
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 state of a database. this is achieved by a sql query running in timed increments, tied to the "tick" event handler of the Timer control. basically, a sql query is run every five seconds to get a count of items in a table.
9
1868
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 reason. I have it enabled and also used the start method. What might the problem be? I've tried System.Windows.Forms.Timers and System.Timers but no luck. Any help appreciated
7
1989
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
1809
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
8266
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8199
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8638
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7196
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2626
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.