Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts

    Javscript Timers, Memory ?

    yo all,

    Just a quick one, just wondering if javascript timers use memory or make the browser crunch CPU?

    Lets say a page had a timer running that runs a really small script that prints a word to a page, every second.. and this timer was ran every day, all day long for 6 months without switching machine off...

    what would happen?

    cheers all,
    Sir P

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    I don't think it matters at all....but might depend on the browser you are using.

    That is to say that if the browser is memory efficient, and there are no memory leaks....the memory used for the timer would obviously be part of the memory used by the browser. In other words, the browser is responsible for handling threads executed in the script...and should clean dead threads when necessary.

    Therefore, one can assume that if the browser handles memory efficiently...it wouldn't matter if you are using a timer or not. However, if your code memory is inefficient (you have a while..or a for loop that never terminates)...then you will have problems with the memory.

    hope that answers your question.

    Regards,
    Ess

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    it does indeed answer my question.

    Many thanks to you


  •  

    Posting Permissions

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