Sure thing, Timer class is the way to go. It was at the back of my mind.
Thanks,
Eddie


-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] Behalf Of John Bergman
Sent: Wednesday, September 27, 2006 5:40 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Triggering events at precise moments of
the day

I thought about having a dedicated thread where I would have lots of
> sleep periods in an infinite loop. After each sleep period, I could
> compare the current time with the time of the next event that must be
> fired. The event would have to be fired in X seconds and I would enter

> in a new sleep

This would be a bad design (IMHO).  If you needed to go with this type
of implementation, you should use the Timer class, and could wake up
periodically, you could probably even determine how long you wanted to
wait between "ticks" of the timer and wake up more closely to what you
need.

If you are running as a console app, you could simply pass it the
command line parameters that you would as if you are running it.  The
only gotcha is that you would by default run as a different user, so you
may want/need to configure the app to run as a specific user.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to