{"id":16343652,"url":"https://github.com/makefu/timed-loop","last_synced_at":"2025-08-03T16:32:51.856Z","repository":{"id":29839474,"uuid":"33384208","full_name":"makefu/Timed-Loop","owner":"makefu","description":"A timed Loop for nodemcu","archived":false,"fork":false,"pushed_at":"2015-04-03T23:15:23.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-27T16:30:23.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makefu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-03T21:44:37.000Z","updated_at":"2015-04-03T23:15:23.000Z","dependencies_parsed_at":"2022-09-06T15:21:11.718Z","dependency_job_id":null,"html_url":"https://github.com/makefu/Timed-Loop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makefu%2FTimed-Loop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makefu%2FTimed-Loop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makefu%2FTimed-Loop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makefu%2FTimed-Loop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makefu","download_url":"https://codeload.github.com/makefu/Timed-Loop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239484208,"owners_count":19646429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T00:25:17.076Z","updated_at":"2025-02-18T13:45:21.017Z","avatar_url":"https://github.com/makefu.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\nThis module implements 'timed' loops with the pattern ``function(i) -\u003e sleep(delay) -\u003efunction(i+1)``.\nThis project is in works-for-me status.\n\n# Usage\n    \n    \u003e -- new timed loop with timer-id 3\n    \u003e l = require('loop').new(3)\n\n    \u003e function derp(i)\n    \u003e     print(\"derp: \"..i..\" id: \"..l:get_tmr_id())\n    \u003e end\n\n    \u003e function yay(i)\n    \u003e     print(\"finished yay! \"..i)\n    \u003e end\n\n    \u003e -- start the loop, count from 1 to 10, increment 1, delay of 1000ms\n    \u003e l:loop(1,10,1,1000,derp)\n\n    \u003e -- use another timer,change the timer id of the current timer\n    \u003e tmr.alarm(4,2000,function () l:set_tmr_id(4) end )\n\n    \u003e -- register 'end' callback\n    \u003e l:on_finished(yay)\n    \u003e -- stop timer after 3.5 seconds, \n    \u003e -- end callback will be executed with the last counter\n    \u003e tmr.alarm(5,3500,function () l:stop() end )\n    \u003e -- Output:\n    derp: 1 id: 3\n    derp: 2 id: 3\n    derp: 3 id: 3\n    derp: 4 id: 4\n    derp: 5 id: 4\n    finished yay! 5\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakefu%2Ftimed-loop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakefu%2Ftimed-loop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakefu%2Ftimed-loop/lists"}