{"id":21637972,"url":"https://github.com/bbc6bae9/jscontext-timer-ios","last_synced_at":"2025-03-19T00:25:33.342Z","repository":{"id":78194941,"uuid":"493215297","full_name":"BBC6BAE9/jscontext-timer-ios","owner":"BBC6BAE9","description":"JSContext支持window.setTimeout、window.setInterval","archived":false,"fork":false,"pushed_at":"2022-05-18T07:19:22.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T01:45:15.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/BBC6BAE9.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-17T11:09:36.000Z","updated_at":"2024-11-08T12:42:29.000Z","dependencies_parsed_at":"2023-04-19T04:56:34.766Z","dependency_job_id":null,"html_url":"https://github.com/BBC6BAE9/jscontext-timer-ios","commit_stats":null,"previous_names":["bbc6bae9/jscontext-timer-ios"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BBC6BAE9%2Fjscontext-timer-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BBC6BAE9%2Fjscontext-timer-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BBC6BAE9%2Fjscontext-timer-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BBC6BAE9%2Fjscontext-timer-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BBC6BAE9","download_url":"https://codeload.github.com/BBC6BAE9/jscontext-timer-ios/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244327798,"owners_count":20435494,"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-25T04:07:47.857Z","updated_at":"2025-03-19T00:25:33.324Z","avatar_url":"https://github.com/BBC6BAE9.png","language":"Objective-C","readme":"# JSContext 支持window.setTimeout\n\n参考1：https://developer.mozilla.org/en-US/docs/Web/API/setTimeout\n\n参考2：https://developer.mozilla.org/en-US/docs/Web/API/setInterval\n\n## JavaScript 调用参考\n\n```javascript\nnativeLog(\"开始计时\");\nvar intervalId = setInterval(function(){nativeLog(\"客户端完成计时 setInterval 任务\");}, 1000);\nnativeLog(intervalId);\nsetTimeout(function(){nativeLog(\"客户端完成计时任务\");clearInterval(intervalId);}, 3000);\n```\n\n## Objective - C 参考\n\n```objective-c\nJSContext *ctx = [[JSContext alloc] init];\n[ctx enableWindowTimer];\nNSString *filePath = [[NSBundle mainBundle] pathForResource:@\"demo\" ofType:@\"js\"];\nNSString *script = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];\n[ctx evaluateScript:script];\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc6bae9%2Fjscontext-timer-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbc6bae9%2Fjscontext-timer-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc6bae9%2Fjscontext-timer-ios/lists"}