{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/4208","repository_url":"https://api.github.com/repos/kripken/emscripten","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/4208/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/4208/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/4208/events","html_url":"https://github.com/kripken/emscripten/pull/4208","id":144355421,"number":4208,"title":"accurate_em_timing_settimeout","user":{"login":"juj","id":225351,"avatar_url":"https://avatars.githubusercontent.com/u/225351?v=3","gravatar_id":"","url":"https://api.github.com/users/juj","html_url":"https://github.com/juj","followers_url":"https://api.github.com/users/juj/followers","following_url":"https://api.github.com/users/juj/following{/other_user}","gists_url":"https://api.github.com/users/juj/gists{/gist_id}","starred_url":"https://api.github.com/users/juj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juj/subscriptions","organizations_url":"https://api.github.com/users/juj/orgs","repos_url":"https://api.github.com/users/juj/repos","events_url":"https://api.github.com/users/juj/events{/privacy}","received_events_url":"https://api.github.com/users/juj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kripken/emscripten/labels/performance","name":"performance","color":"8f45f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-29T18:56:49Z","updated_at":"2016-03-29T19:32:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/4208","html_url":"https://github.com/kripken/emscripten/pull/4208","diff_url":"https://github.com/kripken/emscripten/pull/4208.diff","patch_url":"https://github.com/kripken/emscripten/pull/4208.patch"},"body":"Fix emscripten_set_main_loop() with EM_TIMING_SETTIMEOUT timing mode to properly account for the time spent inside the main loop function when counting the delay for the next frame. Fixes #4200."},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/203064767","html_url":"https://github.com/kripken/emscripten/pull/4208#issuecomment-203064767","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/4208","id":203064767,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T19:32:09Z","updated_at":"2016-03-29T19:32:09Z","body":"We could accumulate the error over multiple frames if you want, so that things would average out in the long term. Not sure it's that important to, though.\r\n\r\nAs for 1ms not feeling good enough - can human beings detect 1ms differences? I don't think so, see cites 8, 9 and 10 [here](https://en.wikipedia.org/wiki/Time_perception#Associated_brain_regions). 1ms is very very small!\r\n\r\nI do suppose most medium to large codebases will use `emscripten_get_now` anyhow, that's a fair point. So perhaps code size does not matter here. However, the indirection still does (even with the optimizations mentioned on irc, unless we can assign `performance.now` etc. directly to `emscripten_get_now`, but there are issues with the `this` pointer)."}}