473,405 Members | 2,300 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,405 software developers and data experts.

Timer

3
Hello all.
I am developing this program:
It has a form with a text box in which user types a number (minutes). Then, he press a button "Start" which counts backwards the interval minutes in the textbox (in seconds) and when the time ends the program does something that it isn't necessary to mention here.

I want to make this work without using Threads, it is working with Threads but it reserves 99% of my CPU !

Thank you in advance.
Jan 31 '08 #1
3 883
Hello all.
I am developing this program:
It has a form with a text box in which user types a number (minutes). Then, he press a button "Start" which counts backwards the interval minutes in the textbox (in seconds) and when the time ends the program does something that it isn't necessary to mention here.

I want to make this work without using Threads, it is working with Threads but it reserves 99% of my CPU !

Thank you in advance.
According to me, no any way for you
Jan 31 '08 #2
leoiser
41
put the time in timer


in timer event write the code...

//here please disable the timer otherwise it will call again & again
Thread t = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(Doproces s));
t.IsBackground = true;
t.start();



Hello all.
I am developing this program:
It has a form with a text box in which user types a number (minutes). Then, he press a button "Start" which counts backwards the interval minutes in the textbox (in seconds) and when the time ends the program does something that it isn't necessary to mention here.

I want to make this work without using Threads, it is working with Threads but it reserves 99% of my CPU !

Thank you in advance.
Jan 31 '08 #3
Anagno
3
I wrote a version using a timer control but the problem was that while counting backwards, the form couldn't be moved or even viewed!
Maybe this cannot work without using threads... ;-(
Unfortunately I am not familiar with this type of code (I support this program, it was not written by me).
I suppose that the code below is for threads.
If you could be more specific I would appreciate that.

Thank you in advance.


put the time in timer


in timer event write the code...

//here please disable the timer otherwise it will call again & again
Thread t = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(Doproces s));
t.IsBackground = true;
t.start();
Jan 31 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
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;...
7
by: Grahmmer | last post by:
I have a few timers that are added to a form at runtime. I can handle the event fine, but I cannot identify which timer fired. Is there a way to do this? Timer Creation: -------------...
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: ...
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...
8
by: KnighT | last post by:
I have a .net service that runs a System.Threading.Timer. The delegate points to the function that the service should execute when the timer elapses. Problem: The timer is not ticking. I have...
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...
11
by: Hotrod2000 | last post by:
I'm quite new to programming but I'm having problems getting a timer to work in visual studio.net I've created a timer on a form, enabled it and then typed the following code (from the mdsn...
16
by: Peter Oliphant | last post by:
Note that although this involves SAPI, it is more a question about Timers and event handlers. I wrote a Speech Recognize handler (SAPI), and put some code in it to enable a Timer. It would not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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...
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...
0
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
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
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...

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.