Multiple Timers, Events Queue, DoEvents Don't Work 
Author Message
 Multiple Timers, Events Queue, DoEvents Don't Work

HI, I have multiple timers. I am using the System.Timers.Timer class. In one
of the timer events I have to call a method on another class that requires
some intinsive processing. That timer has an interval of about 333ms, taking
about 250ms to complete. On the other timer I am performing a some simple
calculation. This timer has an interval of 50ms.

Even with Application.DoEvents inside a loop of the intinsive processing
function called from timer1. The events queue up in timer2 and i get about
5-6 events that happen at the same time.

Please help!

Thanks!



Sun, 03 Apr 2005 01:21:18 GMT  
 Multiple Timers, Events Queue, DoEvents Don't Work
It sounds like you need to run these processes on different threads.  This
way they can all run independently and won't queue up and block eachother
like you are experiencing.  Using threads, you will also be able to set the
priority of different threads so that some get more processor time than
others.
Here's more info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn...
vaconThreadingInVisualBasic.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


Quote:
> HI, I have multiple timers. I am using the System.Timers.Timer class. In
one
> of the timer events I have to call a method on another class that requires
> some intinsive processing. That timer has an interval of about 333ms,
taking
> about 250ms to complete. On the other timer I am performing a some simple
> calculation. This timer has an interval of 50ms.

> Even with Application.DoEvents inside a loop of the intinsive processing
> function called from timer1. The events queue up in timer2 and i get about
> 5-6 events that happen at the same time.

> Please help!

> Thanks!



Sun, 03 Apr 2005 02:57:04 GMT  
 Multiple Timers, Events Queue, DoEvents Don't Work
i was able to repeat the problem using the threading.timer with the same
results. and by creating the system.timer on two seperate threads. it seems
the events are the ones sharing the threads not neccisarily the timers.



Quote:
> It sounds like you need to run these processes on different threads.  This
> way they can all run independently and won't queue up and block eachother
> like you are experiencing.  Using threads, you will also be able to set
the
> priority of different threads so that some get more processor time than
> others.
> Here's more info:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn...
Quote:
> vaconThreadingInVisualBasic.asp

> --
> I hope this helps,
> Steve C. Orr, MCSD
> http://Steve.Orr.net



> > HI, I have multiple timers. I am using the System.Timers.Timer class. In
> one
> > of the timer events I have to call a method on another class that
requires
> > some intinsive processing. That timer has an interval of about 333ms,
> taking
> > about 250ms to complete. On the other timer I am performing a some
simple
> > calculation. This timer has an interval of 50ms.

> > Even with Application.DoEvents inside a loop of the intinsive processing
> > function called from timer1. The events queue up in timer2 and i get
about
> > 5-6 events that happen at the same time.

> > Please help!

> > Thanks!



Mon, 04 Apr 2005 03:38:01 GMT  
 Multiple Timers, Events Queue, DoEvents Don't Work
unable to get these to move two two seperate threads. the only way that I
can do it is to declare a method with no parameters or return values via

new ThreadStart (AddressOf obj.MethodFoo)

although I tried creating a timer and placing the start() method in there it
does not seem to work.



Quote:
> It sounds like you need to run these processes on different threads.  This
> way they can all run independently and won't queue up and block eachother
> like you are experiencing.  Using threads, you will also be able to set
the
> priority of different threads so that some get more processor time than
> others.
> Here's more info:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn...
Quote:
> vaconThreadingInVisualBasic.asp

> --
> I hope this helps,
> Steve C. Orr, MCSD
> http://Steve.Orr.net



> > HI, I have multiple timers. I am using the System.Timers.Timer class. In
> one
> > of the timer events I have to call a method on another class that
requires
> > some intinsive processing. That timer has an interval of about 333ms,
> taking
> > about 250ms to complete. On the other timer I am performing a some
simple
> > calculation. This timer has an interval of 50ms.

> > Even with Application.DoEvents inside a loop of the intinsive processing
> > function called from timer1. The events queue up in timer2 and i get
about
> > 5-6 events that happen at the same time.

> > Please help!

> > Thanks!



Sat, 09 Apr 2005 05:00:58 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Don't work the event.

2. WMI Sink-Events don't work with VB6 (but with VB-Script)

3. MovePrevious don't work but the MoveNext work's fine

4. Timer events have their own DoEvents?

5. Help required with Timer Event, DoEvents, Sleep...an easy one

6. DON'T DoEvents!

7. When doevents don't help ...

8. DoEvents and DataCombo boxes don't mix well =)

9. Script works, script don't work

10. some time's it works, some time it don't

11. I've programmed a game that don't work Help

12. timer event within a timer event

 

 
Powered by phpBB® Forum Software