473,396 Members | 1,886 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,396 software developers and data experts.

Timer and Thread.Sleep()

Hi,

For the taskes which will be executed once a while, I used to write an
endless loop, do the job then call Thread.Sleep().

I just notice threre is server-based Timer. What are the advantages to use
that?

Thanks a lot!
Ryan
BTW, my previous two posts never show up, is this mailing list regulated or
what?
May 22 '07 #1
1 7847
Ryan,

Well, the advantage here is that you are not wasting a thread which is
effectively doing nothing.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ryan Liu" <Ry*******@gmail.comwrote in message
news:u2**************@TK2MSFTNGP02.phx.gbl...
Hi,

For the taskes which will be executed once a while, I used to write an
endless loop, do the job then call Thread.Sleep().

I just notice threre is server-based Timer. What are the advantages to use
that?

Thanks a lot!
Ryan
BTW, my previous two posts never show up, is this mailing list regulated
or what?


May 22 '07 #2

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

Similar topics

8
by: bearophileHUGS | last post by:
Hello, I have four things to ask or to suggest, sorry if they seem basic or already discussed. ------------------- I am still ignorant about Tkinter. This little program, after pressing the...
3
by: RitaG | last post by:
Hi. I Have a VB.Net Windows Application that starts up using Sub Main. It's a program that runs in the background and checks something every minute. I use a Timer to accomplish this and it's...
8
by: Daniel P. | last post by:
I'm trying to set a timer that gets called every 3 seconds so I can update a field in the UI with the time elapsed since the process started. What am I doing wrong that timerDF_Tick does not get...
2
by: linesh.gajera | last post by:
Hi Guys, I am creating a Windows service that call a routine at given interval. Once routine is complete, windows service should wait for 5 minutes and then call the routine again. I was using...
6
by: Thomas | last post by:
hello, what is the better solution if it is possible to choose? a timer or sleep? which one is better for min resources? Thomas
4
by: Lemune | last post by:
Hello everyone. I'm using vb 2005. I'm creating program that run as service on windows. And in my program I need to use timer, so I'm using timer object from component. I try my source code on...
0
by: bg_ie | last post by:
Hi all, I'm writing a .net Com object to read messages from an external bus. Also, under certain situations, I output messages to the bus in order to generate bus load, for testing purposes. An...
5
by: John A. Bailo | last post by:
From a Windows service (NET 2.0) I want to launch serveral threads in a for loop that invokes a method using: new Thread(delegate() { myMethod(248);}).Start(); Will those threads stay...
3
by: Beemer Biker | last post by:
Unaccountably, I cannot re-enable a timer from an background thread. The disable works fine, I just cannot get it to start back up. There is no method "InvokeRequired" like there is for...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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,...

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.