How many loops you'll get? (I get 180.000)

Discussion in 'JavaScript' started by nabil_kadimi, Jul 4, 2007.

  1. #1
    On firefox 2, I get ~180,000 loops in 1 second for this basic while loop with my Acer Travelmate 4500 (1.60Ghz/512MB)
    On IE I get only ~110,000


    <body>
    <script type="text/javascript">
    	now = new Date();
    	future = new Date();
    	future.setSeconds(now.getSeconds()+1);
    	N=0
    	while(now<future){
    		now = new Date();
    		N++
    	}
    	document.write(N + " incrementations in 1 second");
    </script>
    </body>
    HTML:
     
    nabil_kadimi, Jul 4, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Interesting, on Firefox I got many more loops than on IE.
    On old Pentium4 2.4 Ghz:
    96954 on Firefox 2
    51632 on Explorer 7
     
    ajsa52, Jul 5, 2007 IP
  3. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #3
    71,331 Firefox
    162,954 Safari
    - 2.4Ghz Core2 Duo MacBook Pro

    Seems kinda low in comparison to other results.
     
    AdamSee, Jul 9, 2007 IP
  4. nabil_kadimi

    nabil_kadimi Well-Known Member

    Messages:
    1,065
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    195
    #4
    Maybe you had a lot of applications working when you did the test
     
    nabil_kadimi, Jul 9, 2007 IP