.NETGURU
Timers for "larger" intervals?
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Paul J. Hurley
I am working on an application that will repeat a certain procedure after a
user specified time interval. This interval could be as brief as 2
seconds, or as long as once every hour or two. If it was limited to
several seconds or even every few minutes, I would use one of the timer
classes, probably System.Threading.Timer. But I don't know if it's good
practice to allocate a Timer for something as long as a couple of hours. I
know the System.Windows.Forms.Timer has limitations on the interval, but I
can't find any such limits in any of the Threading timers doco.

Is it OK to use a System.Threading.Timer for an hourly interval?

Thanks
Paul
----
Paul Hurley
Caliban Computing
http://www.Caliban.com/
Spam resistant return email address.
Reply to this message...
 
    
Imran Koradia (VIP)
System.Windows.Forms.Timer takes in an Integer value as the interval
represented in milliseconds. With the positive integer values ranging from 1
to 2^32 - 1, you actually have an upper limit of approximately 596.5 hours.
With System.Threading.Timer, one of the constructor takes in longs as well
which gives you an even higher limit. So, as such you shouldn't have to
bother about the upper limit of the timer. Ofcourse, the question is whether
it would make sense to use a timer. Is this a windows app or a console app?
you could make it a console app and schedule it via the windows scheduler
which is probably a good idea if you shouldn't have trouble converting it to
a console app. If not, I cannot think of any reason why a large interval
wouldn't work.

hope that helps..
Imran.

"Paul J. Hurley" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
> I am working on an application that will repeat a certain procedure after
a
[Original message clipped]

Reply to this message...
 
    
Paul J. Hurley
Thanks for the tips, Imran. My app is a data acquisition Windows app. It
periodically checks an external device (or devices) and records, compares,
crunches, etc. the relevant data. The Windows Scheduler would do what I
need, but since I'm not creating a console app I guess it's not an
appropriate choice.

Paul

On Tue, 31 Aug 2004 17:06:26 -0400, "Imran Koradia" <Click here to reveal e-mail address>
wrote:

[Original message clipped]

----
Paul Hurley
Caliban Computing
http://www.Caliban.com/
Spam resistant return email address.
Reply to this message...
 
 
System.Threading.Timer
System.Windows.Forms.Timer




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification