{"action":"created","issue":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/517","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/517/labels{/name}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/517/comments","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/517/events","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/517","id":91847459,"number":517,"title":"RTC accuracy","user":{"login":"patrickhwood","id":2100827,"avatar_url":"https://avatars.githubusercontent.com/u/2100827?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickhwood","html_url":"https://github.com/patrickhwood","followers_url":"https://api.github.com/users/patrickhwood/followers","following_url":"https://api.github.com/users/patrickhwood/following{/other_user}","gists_url":"https://api.github.com/users/patrickhwood/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickhwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickhwood/subscriptions","organizations_url":"https://api.github.com/users/patrickhwood/orgs","repos_url":"https://api.github.com/users/patrickhwood/repos","events_url":"https://api.github.com/users/patrickhwood/events{/privacy}","received_events_url":"https://api.github.com/users/patrickhwood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-29T16:15:14Z","updated_at":"2015-07-07T17:27:06Z","closed_at":null,"body":"I've run some experiments with the RTC (tmr.time()) and found that it's not very accurate when the device is active (most of my tests have been with the dht driver).  It drifts by up to 10 seconds per hour in some cases.\r\n\r\nI've also found that the internal usec clock, system_get_time(), is far more accurate (at least on one test board; I will try others soon), presumably because it's connected directly to a divider on the xtal.  I replaced the code for tmr.time() to use this clock, compensating for when it rolls over every ~4000 sec, and found it drifted ~2 seconds over 10 hours, when compared against an NTP synchronized linux system.\r\n\r\nHas anyone done any real tests of the various clocks available in the SDK?"},"comment":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/comments/119275776","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/517#issuecomment-119275776","issue_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/517","id":119275776,"user":{"login":"saitejalakkimsetty","id":11802394,"avatar_url":"https://avatars.githubusercontent.com/u/11802394?v=3","gravatar_id":"","url":"https://api.github.com/users/saitejalakkimsetty","html_url":"https://github.com/saitejalakkimsetty","followers_url":"https://api.github.com/users/saitejalakkimsetty/followers","following_url":"https://api.github.com/users/saitejalakkimsetty/following{/other_user}","gists_url":"https://api.github.com/users/saitejalakkimsetty/gists{/gist_id}","starred_url":"https://api.github.com/users/saitejalakkimsetty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saitejalakkimsetty/subscriptions","organizations_url":"https://api.github.com/users/saitejalakkimsetty/orgs","repos_url":"https://api.github.com/users/saitejalakkimsetty/repos","events_url":"https://api.github.com/users/saitejalakkimsetty/events{/privacy}","received_events_url":"https://api.github.com/users/saitejalakkimsetty/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T17:27:06Z","updated_at":"2015-07-07T17:27:06Z","body":"@patrickhwood Where is the `system_get_time()` located and how do I use it?"}}