Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript setinterval() lag in Firefox?
    primarykey
    data
    text
    <p>I have wrote this code to make seconds (with decisec &amp; centisec) counting up.</p> <pre><code> You've wasted time &lt;span id="alltime"&gt;0.00&lt;/span&gt; seconds. &lt;script type="text/javascript"&gt; function zeroPad(num,count) { var numZeropad = num + ''; while(numZeropad.length &lt; count) { numZeropad = "0" + numZeropad; } return numZeropad; } function counttwo() { tall = document.getElementById('alltime').innerHTML; if(parseFloat(tall) &lt; 1.00) { tnew2 = tall.replace('0.0','').replace('0.',''); } else { tnew2 = tall.replace('.',''); } tnum = parseInt(tnew2) + 1; //check if have to add zero if(tnum &gt;= 100) { tstr1 = tnum + ''; } else { tstr1 = zeroPad(tnum,3); } tlast = tstr1.substr(0,tstr1.length - 2) + '.' + tstr1.substr(tstr1.length - 2); document.getElementById("alltime").innerHTML = tlast; } var inttwo=setInterval("counttwo()",10); &lt;/script&gt; </code></pre> <p>In HTML document and run.</p> <p>It works well but when I use Firefox 4 and run the code. Seems like it LAG a bit (stop a bit before counting up) when it's on some numbers (randomly like 12.20, 4.43). I've tried change "counttwo()" to counttwo but that doesn't help.</p> <p>I have told some of my friends to run on Firefox 4 too. They said it doesn't lag at all. This cause because of my computer ? or My Firefox ? or something else ?</p> <p>Thanks in advance!</p> <p>PS. Fiddle here: <a href="http://jsfiddle.net/XvkGy/5/" rel="nofollow">http://jsfiddle.net/XvkGy/5/</a> Mirror: <a href="http://bit.ly/hjVtXS" rel="nofollow">http://bit.ly/hjVtXS</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload