{"action":"created","issue":{"url":"https://api.github.com/repos/tqdm/tqdm/issues/60","labels_url":"https://api.github.com/repos/tqdm/tqdm/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/tqdm/tqdm/issues/60/comments","events_url":"https://api.github.com/repos/tqdm/tqdm/issues/60/events","html_url":"https://github.com/tqdm/tqdm/pull/60","id":119391838,"number":60,"title":"relative timing for unit tests","user":{"login":"lrq3000","id":1118942,"avatar_url":"https://avatars.githubusercontent.com/u/1118942?v=3","gravatar_id":"","url":"https://api.github.com/users/lrq3000","html_url":"https://github.com/lrq3000","followers_url":"https://api.github.com/users/lrq3000/followers","following_url":"https://api.github.com/users/lrq3000/following{/other_user}","gists_url":"https://api.github.com/users/lrq3000/gists{/gist_id}","starred_url":"https://api.github.com/users/lrq3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrq3000/subscriptions","organizations_url":"https://api.github.com/users/lrq3000/orgs","repos_url":"https://api.github.com/users/lrq3000/repos","events_url":"https://api.github.com/users/lrq3000/events{/privacy}","received_events_url":"https://api.github.com/users/lrq3000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lrq3000","id":1118942,"avatar_url":"https://avatars.githubusercontent.com/u/1118942?v=3","gravatar_id":"","url":"https://api.github.com/users/lrq3000","html_url":"https://github.com/lrq3000","followers_url":"https://api.github.com/users/lrq3000/followers","following_url":"https://api.github.com/users/lrq3000/following{/other_user}","gists_url":"https://api.github.com/users/lrq3000/gists{/gist_id}","starred_url":"https://api.github.com/users/lrq3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrq3000/subscriptions","organizations_url":"https://api.github.com/users/lrq3000/orgs","repos_url":"https://api.github.com/users/lrq3000/repos","events_url":"https://api.github.com/users/lrq3000/events{/privacy}","received_events_url":"https://api.github.com/users/lrq3000/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-11-29T22:17:41Z","updated_at":"2015-12-25T18:55:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tqdm/tqdm/pulls/60","html_url":"https://github.com/tqdm/tqdm/pull/60","diff_url":"https://github.com/tqdm/tqdm/pull/60.diff","patch_url":"https://github.com/tqdm/tqdm/pull/60.patch"},"body":"Should fix #59 by using relative (cpu) timing (`time.process_time()` for Py3.3+ or `time.clock()` for Py2) instead of absolute timing (`time.time()`). This should allow to reliably execute the unit tests that are time dependent, even if the Travis server is suddenly overloaded in the middle of a test.\r\n\r\nSigned-off-by: Stephen L. <lrq3000@gmail.com>"},"comment":{"url":"https://api.github.com/repos/tqdm/tqdm/issues/comments/167257386","html_url":"https://github.com/tqdm/tqdm/pull/60#issuecomment-167257386","issue_url":"https://api.github.com/repos/tqdm/tqdm/issues/60","id":167257386,"user":{"login":"lrq3000","id":1118942,"avatar_url":"https://avatars.githubusercontent.com/u/1118942?v=3","gravatar_id":"","url":"https://api.github.com/users/lrq3000","html_url":"https://github.com/lrq3000","followers_url":"https://api.github.com/users/lrq3000/followers","following_url":"https://api.github.com/users/lrq3000/following{/other_user}","gists_url":"https://api.github.com/users/lrq3000/gists{/gist_id}","starred_url":"https://api.github.com/users/lrq3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrq3000/subscriptions","organizations_url":"https://api.github.com/users/lrq3000/orgs","repos_url":"https://api.github.com/users/lrq3000/repos","events_url":"https://api.github.com/users/lrq3000/events{/privacy}","received_events_url":"https://api.github.com/users/lrq3000/received_events","type":"User","site_admin":false},"created_at":"2015-12-25T18:55:24Z","updated_at":"2015-12-25T18:55:24Z","body":"Proof that it's a time resolution issue, but only using clock():\r\n\r\n```\r\ndef cpu_timify(t):\r\n    process_time()\r\n    t._time = process_time\r\n    t.start_t = t.last_print_t = t._time()\r\n    print(\"%s | %s | %s | %s\" % (repr(t.start_t), repr(process_time()), repr(time.clock()), repr(time.time()) ) )\r\n```\r\n\r\nResult:\r\n```\r\n0.19 | 0.19 | 0.19 | 1451069514.610997\r\n```\r\n\r\nThe low time resolution completely put off all the tests based on rate variations."}}