Results 1 to 8 of 8

Thread: timer eats process?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    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.

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    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...

  3. #3
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    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.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    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.

  5. #5
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    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.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    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.

  7. #7
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    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?

  8. #8
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    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.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width