|
-
Dec 4th, 2007, 06:02 PM
#1
Thread Starter
Frenzied Member
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.
-
Dec 4th, 2007, 11:23 PM
#2
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...
-
Dec 5th, 2007, 12:08 AM
#3
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.
-
Dec 5th, 2007, 05:53 PM
#4
Thread Starter
Frenzied Member
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.
-
Dec 5th, 2007, 10:05 PM
#5
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.
-
Dec 6th, 2007, 12:49 AM
#6
Thread Starter
Frenzied Member
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.
-
Dec 6th, 2007, 02:29 AM
#7
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?
-
Dec 6th, 2007, 05:59 PM
#8
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|