{"action":"created","issue":{"url":"https://api.github.com/repos/d3/d3-timer/issues/27","repository_url":"https://api.github.com/repos/d3/d3-timer","labels_url":"https://api.github.com/repos/d3/d3-timer/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/d3/d3-timer/issues/27/comments","events_url":"https://api.github.com/repos/d3/d3-timer/issues/27/events","html_url":"https://github.com/d3/d3-timer/issues/27","id":247848588,"number":27,"title":"Execution time of one callback gives incorrect elapsed time in another ","user":{"login":"magjac","id":6350376,"avatar_url":"https://avatars1.githubusercontent.com/u/6350376?v=4","gravatar_id":"","url":"https://api.github.com/users/magjac","html_url":"https://github.com/magjac","followers_url":"https://api.github.com/users/magjac/followers","following_url":"https://api.github.com/users/magjac/following{/other_user}","gists_url":"https://api.github.com/users/magjac/gists{/gist_id}","starred_url":"https://api.github.com/users/magjac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magjac/subscriptions","organizations_url":"https://api.github.com/users/magjac/orgs","repos_url":"https://api.github.com/users/magjac/repos","events_url":"https://api.github.com/users/magjac/events{/privacy}","received_events_url":"https://api.github.com/users/magjac/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-03T22:03:47Z","updated_at":"2017-08-03T22:09:26Z","closed_at":"2017-08-03T22:09:26Z","body":"This probably has the same root cause as https://github.com/d3/d3-timer/issues/26.\r\n\r\nhttps://bl.ocks.org/magjac/d187319570dcdcf3beb39ae0aec75d81\r\n\r\nSee the console output. The second callback is called with the same elapsed time as the first one, even though the first one has a considerable execution time. On my computer the elapsed time error is as much as 376 ms."},"comment":{"url":"https://api.github.com/repos/d3/d3-timer/issues/comments/320103532","html_url":"https://github.com/d3/d3-timer/issues/27#issuecomment-320103532","issue_url":"https://api.github.com/repos/d3/d3-timer/issues/27","id":320103532,"user":{"login":"mbostock","id":230541,"avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"created_at":"2017-08-03T22:09:26Z","updated_at":"2017-08-03T22:09:26Z","body":"This is the expected behavior. Both of your timers are scheduled to fire at the same time (at one-second intervals after page loads). If one of these timers then blocks the execution of JavaScript, it doesn’t affect the apparent elapsed time the other timers see, since conceptually the timers are firing at the same time. The intent of this design is that you can schedule multiple timers to file simultaneously, and their *elapsed* times will be exactly synchronized, even if some of those timers do something computationally expensive. This is useful in implementing synchronized animations of many elements, for example."}}
{"actor":{"display_login":"mbostock"}}