473,473 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Timer Confusion

I am new to using timers and am not sure which timer is best used for
the timer driven vb program described below. Also, if I should use one
master timer or a timer for each button (system resource load).
Examples are welcome as I'm sure I'll have problems starting the code
for this (primarily write vbscript and rarely vb).

Timers: System.Windows.Forms.Timer, System.Timers.Timer, or
System.Threading.Timer?

Visualize the form as a checkerboard and each square on the form is a
button. Any one of the buttons should be able to start (and display) a
countdown, say 15 minutes to zero, based on an event trigger. Each
button can start and display a countdown at any time independent of the
other buttons. When a button is clicked the countdown stops. The
program will need to process other functions aside from the timers so I
am also concerned with program events that may interrupt the timers
countdown display on each button.

I was thinking System.Timers.Timer would be best because the timers
will run in their own thread other than the programs UI. Also, due to
the large number of button controls and multiple independent
countdowns.

Examples or links to similar code would be very helpful.

Thank you for your help.

Dec 27 '05 #1
1 1216
18*****@dotvelocity.com wrote:
I am new to using timers and am not sure which timer is best used for
the timer driven vb program described below. Also, if I should use one
master timer or a timer for each button (system resource load).
Examples are welcome as I'm sure I'll have problems starting the code
for this (primarily write vbscript and rarely vb).

Timers: System.Windows.Forms.Timer, System.Timers.Timer, or
System.Threading.Timer?

Visualize the form as a checkerboard and each square on the form is a
button. Any one of the buttons should be able to start (and display) a
countdown, say 15 minutes to zero, based on an event trigger. Each
button can start and display a countdown at any time independent of the
other buttons. When a button is clicked the countdown stops. The
program will need to process other functions aside from the timers so I
am also concerned with program events that may interrupt the timers
countdown display on each button.

I was thinking System.Timers.Timer would be best because the timers
will run in their own thread other than the programs UI. Also, due to
the large number of button controls and multiple independent
countdowns.

Examples or links to similar code would be very helpful.

Thank you for your help.


If you just have each button remember it's start/stop time then you only
need one timer. Each second, refresh every button's display.

Chris
Dec 28 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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;...
2
by: John David Thornton | last post by:
I've got a Windows Service class, and I put a System.Threading.Timer, and I've coded it as shown below. However, when I install the service and then start it in MMC, I get a peculiar message: ...
10
by: jason_box | last post by:
Hello, I was wondering if there was a way to have a javacript be activated by an input button that would call to a cgi program and querey every 10minutes and the cgi would update the page without...
2
by: archana | last post by:
Hi all, I am having one confusion regarding windows based timer. I read somewhere that 'Be careful with stopping, because stopped timers are disabled and are subject to garbage collection....
5
by: archana | last post by:
Hi all, I am using timer to do some functionality on user specified time. I am using system.timers.timer class and its timer to do this functionality. What i am doing is i set autoreset to...
12
by: Gina_Marano | last post by:
I have created an array of timers (1-n). At first I just created windows form timers but I read that system timers are better for background work. The timers will just be monitoring different...
5
by: Tony Gravagno | last post by:
I have a class that instantiates two Timer objects that fire at different intervals. My class can be instantiated within a Windows Form or from a Windows Service. Actions performed by one of the...
8
by: =?Utf-8?B?RGF2ZSBCb29rZXI=?= | last post by:
I have a Timer that I set to go off once a day, but it frequently fails! In order to debug I would like to be able to check, at any moment, whether the Timer is enabled and when it will next...
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
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.