Search:
Namespaces
Discussions
.NET v1.1
Feedback
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
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com