{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/4751","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/4751/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/4751/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/4751/events","html_url":"https://github.com/esp8266/Arduino/issues/4751","id":324867665,"number":4751,"title":"Loop on 8266 gets slower and slower the longer it runs.","user":{"login":"ondabeach","id":20894163,"avatar_url":"https://avatars3.githubusercontent.com/u/20894163?v=4","gravatar_id":"","url":"https://api.github.com/users/ondabeach","html_url":"https://github.com/ondabeach","followers_url":"https://api.github.com/users/ondabeach/followers","following_url":"https://api.github.com/users/ondabeach/following{/other_user}","gists_url":"https://api.github.com/users/ondabeach/gists{/gist_id}","starred_url":"https://api.github.com/users/ondabeach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ondabeach/subscriptions","organizations_url":"https://api.github.com/users/ondabeach/orgs","repos_url":"https://api.github.com/users/ondabeach/repos","events_url":"https://api.github.com/users/ondabeach/events{/privacy}","received_events_url":"https://api.github.com/users/ondabeach/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":52,"created_at":"2018-05-21T10:33:58Z","updated_at":"2018-05-24T01:12:40Z","closed_at":null,"author_association":"NONE","body":"I was running 2.30 core on a NodeMCU and ran into this problem, so I updated to the latest (2.41) and the problem persists.\r\n\r\nAnyone know what is going on here?\r\n\r\nRunning the simple sketch below demonstrates what seems to be a timing drift of some sort. As soon as the sketch starts the time taken to loop increases quite quickly. Then it stabilises for a while and only varies by a few loops second by second before dropping quickly by around 1000 iterations per second then stabilizing again for a while. It just seems to keep going in the same fashion as you can see by the output below the sketch.\r\n\r\nThe gaps in the output are where I have edited out most of the output from the stable periods so this post wasn't thousands of lines long.\r\n\r\nSKETCH:\r\n////////////////////////////////////////////////////\r\nlong lastTime;\r\nlong loops=0;\r\n\r\nvoid setup(){\r\n  Serial.begin(115200);\r\n}\r\nvoid loop(){\r\n  loops++;\r\n  if(millis()>=lastTime+1000){\r\n    Serial.println(String(loops));\r\n    loops=0;\r\n    lastTime=millis();\r\n  } \r\n}\r\n////////////////////////////////////////////////////////////\r\n\r\nOUTPUT:\r\n//////////////////////////////////////////////////////\r\n112312\r\n112313\r\n112311\r\n112312\r\n112312\r\n112311\r\n112312\r\n112312\r\n112311\r\n112314\r\n112312\r\n112314\r\n111547\r\n110907\r\n110911\r\n110907\r\n110908\r\n110908\r\n110909\r\n110909\r\n110908\r\n110907\r\n110909\r\n110909\r\n110904\r\n110909\r\n110909\r\n110909\r\n110907\r\n110907\r\n110910\r\n110909\r\n110907\r\n110909\r\n110908\r\n110910\r\n110908\r\n110906\r\n110910\r\n110908\r\n110907\r\n110911\r\n110907\r\n110910\r\n\r\n\r\n\r\n110908\r\n110910\r\n110909\r\n110910\r\n110909\r\n110912\r\n110910\r\n110312\r\n109539\r\n109541\r\n109540\r\n109541\r\n109537\r\n109539\r\n109541\r\n109540\r\n109539\r\n109542\r\n109540\r\n109541\r\n109540\r\n109541\r\n109541\r\n109540\r\n109539\r\n109541\r\n109540\r\n109541\r\n\r\n\r\n\r\n\r\n109541\r\n109541\r\n109539\r\n109541\r\n109541\r\n109541\r\n109541\r\n109247\r\n108206\r\n108205\r\n108204\r\n108209\r\n108204\r\n108205\r\n108205\r\n108203\r\n108205\r\n108205\r\n108203\r\n108206\r\n108204\r\n108205\r\n/////////////////////////////////////////////////////////////////////////////"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/391555868","html_url":"https://github.com/esp8266/Arduino/issues/4751#issuecomment-391555868","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/4751","id":391555868,"user":{"login":"RudyFiero","id":10385754,"avatar_url":"https://avatars1.githubusercontent.com/u/10385754?v=4","gravatar_id":"","url":"https://api.github.com/users/RudyFiero","html_url":"https://github.com/RudyFiero","followers_url":"https://api.github.com/users/RudyFiero/followers","following_url":"https://api.github.com/users/RudyFiero/following{/other_user}","gists_url":"https://api.github.com/users/RudyFiero/gists{/gist_id}","starred_url":"https://api.github.com/users/RudyFiero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RudyFiero/subscriptions","organizations_url":"https://api.github.com/users/RudyFiero/orgs","repos_url":"https://api.github.com/users/RudyFiero/repos","events_url":"https://api.github.com/users/RudyFiero/events{/privacy}","received_events_url":"https://api.github.com/users/RudyFiero/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T01:12:40Z","updated_at":"2018-05-24T01:12:40Z","author_association":"NONE","body":"@Irmoreno007 \r\n\r\n> As an observation, I get less loops / seconds than all of you, even with the original sketch.\r\n\r\nI am getting much the same as you are. Other than the setup, I am running the original sketch."}}
{"actor":{"display_login":"RudyFiero"}}