later icon indicating copy to clipboard operation
later copied to clipboard

double execution in google chrome and opera but not firefox

Open alexanderlvov1 opened this issue 11 years ago • 4 comments

Hi,

I am doing a POC using later and discovered trying to execute a function on time gives double execution, one on time and second time a few seconds later. I tested in Google Crome, Opera and Firefox. In firefox it looks good but in Google Chrome i get these double executions which feels quite unstable to me. The code is straigforward too. My PC is WIN7 PRO with intel i7 quad core, Please advice how to fix.

alexanderlvov1 avatar Feb 14 '14 14:02 alexanderlvov1

opera is behvaing like google chrome

<script type="text/javascript" src="js/later.js"></script>
<script type="text/javascript" src="js/jquery-1.9.2.min.js"></script>
<script type="text/javascript">
    var textSched = later.parse.text('every 15 sec');
   // var textSched = later.parse.recur().every(1).minute();
    var timer2 = later.setInterval(changeFrameSrc, textSched);

     function changeFrameSrc() {
        alert(new Date());
         //timer2.clear();
        // $("#showSrc").attr('src', 'http://www.w3schools.com');
    }


</script>

alexanderlvov1 avatar Feb 14 '14 14:02 alexanderlvov1

What's the result of (new Date()).getTime() within changeFrameSrc()? Could you let it run for a minute and capture the output?

bunkat avatar Feb 14 '14 21:02 bunkat

ok, i changed alert to console.log and captured this.

* in google chrome version 32.0.1700.107* Sat Feb 15 2014 10:10:00 GMT-0400 (Atlantic Standard Time) show2.html:16 Sat Feb 15 2014 10:10:00 GMT-0400 (Atlantic Standard Time) show2.html:16 Sat Feb 15 2014 10:10:15 GMT-0400 (Atlantic Standard Time) show2.html:16 Sat Feb 15 2014 10:10:15 GMT-0400 (Atlantic Standard Time) show2.html:16 Sat Feb 15 2014 10:10:30 GMT-0400 (Atlantic Standard Time) show2.html:16 Sat Feb 15 2014 10:10:30 GMT-0400 (Atlantic Standard Time) show2.html:16 Sat Feb 15 2014 10:10:45 GMT-0400 (Atlantic Standard Time) show2.html:16 Sat Feb 15 2014 10:10:45 GMT-0400 (Atlantic Standard Time) show2.html:16 Sat Feb 15 2014 10:11:00 GMT-0400 (Atlantic Standard Time) show2.html:16 Sat Feb 15 2014 10:11:00 GMT-0400 (Atlantic Standard Time) show2.html:16


_in firefox 27.0.1_**** Date {Sat Feb 15 2014 10:13:30 GMT-0400 (Atlantic Standard Time)} show2.html (line 16) Date {Sat Feb 15 2014 10:13:45 GMT-0400 (Atlantic Standard Time)} show2.html (line 16) Date {Sat Feb 15 2014 10:14:00 GMT-0400 (Atlantic Standard Time)} show2.html (line 16) Date {Sat Feb 15 2014 10:14:15 GMT-0400 (Atlantic Standard Time)} show2.html (line 16) Date {Sat Feb 15 2014 10:14:30 GMT-0400 (Atlantic Standard T


alexanderlvov1 avatar Feb 15 '14 14:02 alexanderlvov1

sorry, i used getTime() now

in google chrome


1392474015189 show2.html:16 1392474015348 show2.html:16 1392474030202 show2.html:16 1392474030359 show2.html:16 1392474045204 show2.html:16 1392474045361 show2.html:16 1392474060205 show2.html:16 1392474060361 show2.html:16


in firefox


1392474120966 show2.html (line 16) 1392474135971 show2.html (line 16) 1392474150992 show2.html (line 16) 1392474165013 show2.html (line 16) 1392474180017

alexanderlvov1 avatar Feb 15 '14 14:02 alexanderlvov1