-
timer eats process?
hi guys, I have a question about using the timer in my application. I used the timer to look for a window in case the user goes to that window. My question is -
If an exe that uses Timer in it, would that slower the process down than the exe that doesn't use the Timer? In other word, I can either choose to look for that window or not.
-
Re: timer eats process?
Yes, it will consume CPU time as all procedures do. The more pertinent question is the amount of processing done per timer event...
-
Re: timer eats process?
you should also make sure there is NEVER a doevents in a timer sub. This will cause a lot of problems if the timer has a small interval.
-
Re: timer eats process?
Is there an article about this? I wonder if this is a bad solution or not to put the timer in the code? And no, I don't have doevents in the code. I can't tell whether or not it slows the process. The timer interval is 1000 I set.
-
Re: timer eats process?
timers don't slow the code down. All they are is basically an event fired at a predetermined interval, and you are only calling them once per second! What slows code down is bad coding. the only real issue with timers is that there are only so many available for vb to use. I think the number is 10. so it's best to make sure you only use one in your program at a time.
-
Re: timer eats process?
what is number 10? My concern is that it would consume up the CPU process of my client. Are you saying there are 10 timers for vb to use? what are they? and how do I make sure it's best to make sure I only use one in my code? I only use one Timer on the form.
-
Re: timer eats process?
Have you heard of the phrase "It's not the size, it's how you use it."?
Your missing the point, its not so much the existence per se of a timer in your project... so its there, so it isnt, so what... its how you use the timer. What processing is done by the timer? How often is the timer fired? How long will it take or will it finish before timer event fires again?
-
Re: timer eats process?
the #10 is the amount of timers all running visual basic programs at the same time are allowed to use. I don't think the limit applies to .net apps.