Re: Threading Timer_Elapsed

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 11/29/04


Date: Mon, 29 Nov 2004 15:33:11 -0600

NewUser,
In addition to the other comments (especially Tom's about the
SynchronizingObject property).

The following article in MSDN Magazine explains the difference between the
three timer objects in .NET & when to use each.

http://msdn.microsoft.com/msdnmag/issues/04/02/TimersinNET/default.aspx

The above article also discusses if & how each timer interacts with
threading.

Hope this helps
Jay

"NewUser" <NewUser@discussions.microsoft.com> wrote in message
news:FF1A7650-1334-489C-9C6F-4B3AF134C21A@microsoft.com...
> Hello,
>
> I'm a new user to Visual Basic.net and I would appreciate any help
> regarding
> a problem I have. I have searched the posts in this newsgroup and the VB
> library for threading topics, but I get confused with the code that is
> displayed. Anyway, I have a System.Timers.Timer object in a form and its
> interval is 50 ms. I want to create a thread around the Timer_Elapsed
> event
> (ie. myThread = new System.Threading.Thread(AddressOf Timer_Elapsed)) but
> the signature doesn't match the delegate. Could someone please tell me
> how
> to create a thread around this event? I did look up Threaded Timers but I
> got even more confused with the code. Thanks in advance.



Relevant Pages

  • Re: Timers and Serial
    ... I tried using two timers but it seems that the timers are having the same threading problem. ... I disable one timer at a point in my program but it seems that the reamining timer is being interrupted by itself. ... Its tick event is called before it can finish the last one. ...
    (microsoft.public.pocketpc.developer)
  • Re: Windows Service and TCP Listener
    ... My code was trying to execute once and once only. ... I corrected the define for the listener and everything works like a champ. ... > seconds the TimerFired method is invoked via the event on the timer. ... > you are having threading issues, ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Timer
    ... Python standard library offers a 'Timer' class as part ... of its threading library. ... which calls its target function just once. ... def run: ...
    (comp.lang.python)
  • Re: Timers and Serial
    ... I need to disable the timer because the ProcessData function takes a very long time. ... I'm not usre exactly how the threading works in general. ... > serial port by error. ... Does it need any speical done to prevent a threading problem? ...
    (microsoft.public.pocketpc.developer)
  • Re: timer and triggers
    ... I'm trying to generate triggers at the start of specific times so I've ... created a timer object. ... random variables. ... I also have two timer objects per event per node: ...
    (comp.soft-sys.matlab)