{"id":20226169,"url":"https://github.com/steamerjs/steamer-timer","last_synced_at":"2026-06-07T08:32:17.477Z","repository":{"id":57370614,"uuid":"64645716","full_name":"steamerjs/steamer-timer","owner":"steamerjs","description":"timer utils","archived":false,"fork":false,"pushed_at":"2016-08-02T16:23:08.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T23:02:11.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steamerjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-01T07:29:04.000Z","updated_at":"2016-08-02T16:22:11.000Z","dependencies_parsed_at":"2022-08-29T19:00:24.966Z","dependency_job_id":null,"html_url":"https://github.com/steamerjs/steamer-timer","commit_stats":null,"previous_names":["steamerteam/steamer-timer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamerjs%2Fsteamer-timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steamerjs","download_url":"https://codeload.github.com/steamerjs/steamer-timer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241439470,"owners_count":19963097,"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-11-14T07:16:38.444Z","updated_at":"2026-06-07T08:32:17.417Z","avatar_url":"https://github.com/steamerjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## steamer-timer\ntimer util for development\n\n\n\n## Functions\n* Timer.wait\n    - same as setTimeout\n    - callback  [Function]\n    - wait time [String|Int] x days|d x hours|hrs|h x minutes|mins|m x seconds|secs|s x milliseconds|ms\n\n```\nTimer.wait(function() {\n    console.log(\"===wait 1s===\");\n}, 1000);\n\nTimer.wait(function() {\n    console.log(\"===wait 2s===\");\n}, \"2s\");\n```\n\n* Timer.repeat\n    - same as setInterval\n    - callback    [Function]\n    - repeat time [Strin|Int] x days|d x hours|hrs|h x minutes|mins|m x seconds|secs|s x milliseconds|ms\n\n```\nvar tick = 0;\nvar timerId1 = Timer.repeat(function() {\n    tick++;\n    console.log(\"===tick:\" + tick + \"===\");\n    if (tick \u003e 3) {\n        Timer.clear(timerId1);\n    }\n}, \"1s\");\n```\n\n* Timer.until\n    - use setTimeout. wait until sometime to push the callback to event loop\n    - callback   [Function]\n    - until time [String] xxxx-xx-xx xx:xx:xx\n```\nTimer.until(function() {\n    console.log(\"until 2016-08-02 11:32:30\");\n}, \"2016-08-02 23:32:50\");\n```\n\n* Timer.frame\n    - same as requestAnimationFrame\n    - callback [Function]\n```\nvar left = 0;\nfunction moveBar(timeStamp) {\n    var bar = document.getElementById(\"bar\");\n    left += 10;\n    bar.style.marginLeft = left + \"px\";\n\n    if (left \u003c= 500) {\n        Timer.frame(moveBar);\n    }\n}\nTimer.frame(moveBar);\n```\n\n* Timer.clear\n    - clear above timers\n    - timerId [Int]\n```\nTimer.clear(timerId1);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Fsteamer-timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteamerjs%2Fsteamer-timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamerjs%2Fsteamer-timer/lists"}