Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2005

Tip: Looking for answers? Try searching our database.

Manually Firing off Timer.ElapsedEvent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Weston Weems - 06 Jan 2005 17:22 GMT
Hello,

I've got timers launching every 3 minutes to run a
somewhat lengthy process etc... and that all works fine.

What I'd like is to have the timer fire immediately after
starting then at <X> intervals.

With System.Timers.Timer, is there a way I can manually
fire off the event. Or will I just have to manually create
a thread and fire the event the first time?

Seems like its pretty common behavior to want a timer to
fire once started then fire at x intervals.

Thanks in advance
Weston Weems
Rob Vretenar - 06 Jan 2005 21:09 GMT
You may want to take a look at the System.Threading.Timer class
instead.  This is a thread-safe representation of a timer and differs
from the Timers namespace in a couple of ways.  First the constructor
allows you to specify when the first timer should fire (which you want
to fire right away) and then to specify an interval for how often it
should fire after the first one.
Secondly, instead of using events and event handlers, you are simply
able to specify a callback function.
Hope this helps
Rob Vretenar [imason inc.]

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.