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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts

    Question Please, tell me how many resources this code will waste

    Code:
    <html>
    <head> 
    <title>Waster</title>
    <script>
    init = function(){
        setInterval(function(){
           if (true){}else{new function(){for(var i = 10000;i--;)
           {"Object".subString(1,2)}}}},1000);
    }
    </script>
    </head>
    <body onload=init()>
    
    </body>
    </html>
    Because Im not a hardware guy
    Im not sure how to measre the
    wasred resouces here any help
    wil get my thanks.
    Only the foolishly brave should try this,
    I've been told it never stops.
    What a fate.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    I think maybe the biggest waste of resources was the time you took to write that.

    Aside from occupying the CPU for a few nanoseconds every second, it doesn't do anything or use any resources.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Quote Originally Posted by Old Pedant View Post
    I think maybe the biggest waste of resources was the time you took to write that.

    Aside from occupying the CPU for a few nanoseconds every second, it doesn't do anything or use any resources.
    Thank You

    and
    after some consideration,
    well said
    Last edited by DaveyErwin; 09-01-2010 at 01:13 AM. Reason: I aint humble enough

  • #4
    Regular Coder
    Join Date
    Apr 2010
    Posts
    163
    Thanks
    3
    Thanked 25 Times in 25 Posts
    if(true){}
    that will freeze your browser.

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    Quote Originally Posted by gizmo1650 View Post
    if(true){}
    that will freeze your browser.
    Ummm...oooookkkkaaaaaaaaaaaaaayyyy
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #6
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Quote Originally Posted by gizmo1650 View Post
    if(true){}
    that will freeze your browser.

    Quote Originally Posted by Old Pedant View Post
    Ummm...oooookkkkaaaaaaaaaaaaaayyyy
    well, he did snag onto the relative bit , eh ?

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    I think I will let the two of you go have a private conversation before this thread drives me crazier than I am already.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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