{"id":1156,"url":"https://github.com/comyar/Chronos-Swift","last_synced_at":"2025-07-30T20:32:37.999Z","repository":{"id":29622490,"uuid":"33163241","full_name":"comyar/Chronos-Swift","owner":"comyar","description":":hourglass: Grand Central Dispatch Utilities","archived":false,"fork":false,"pushed_at":"2017-11-28T18:28:23.000Z","size":155,"stargazers_count":248,"open_issues_count":6,"forks_count":28,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-05-15T23:47:26.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/comyar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-31T03:40:19.000Z","updated_at":"2023-07-06T23:38:58.000Z","dependencies_parsed_at":"2022-08-21T02:20:59.722Z","dependency_job_id":null,"html_url":"https://github.com/comyar/Chronos-Swift","commit_stats":null,"previous_names":["comyarzaheri/chronos-swift"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comyar%2FChronos-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comyar%2FChronos-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comyar%2FChronos-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comyar%2FChronos-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/comyar","download_url":"https://codeload.github.com/comyar/Chronos-Swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228187539,"owners_count":17882322,"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-01-05T20:15:40.123Z","updated_at":"2024-12-04T20:31:02.279Z","avatar_url":"https://github.com/comyar.png","language":"Swift","funding_links":[],"categories":["GCD","Libs","WebSocket"],"sub_categories":["Getting Started","Thread","Other free courses","Linter"],"readme":"![](header.png)\n\n# Overview\n[![Build Status](https://travis-ci.org/comyar/Chronos-Swift.svg)](https://travis-ci.org/comyar/Chronos-Swift)\n[![Version](http://img.shields.io/cocoapods/v/Chronos-Swift.svg)](http://cocoapods.org/?q=Chronos)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Olympus-Library/Chronos-Swift)\n[![Platform](http://img.shields.io/cocoapods/p/Chronos-Swift.svg)]()\n[![License](http://img.shields.io/cocoapods/l/Chronos-Swift.svg)](https://github.com/Olympus-Library/Chronos/blob/master/LICENSE)\n[![git-brag-stats](https://labs.turbo.run/git-brag?user=comyar\u0026repo=Chronos-Swift)](https://github.com/comyar/Chronos-Swift)\n\nChronos is a collection of useful Grand Central Dispatch utilities. If you have any specific requests or ideas for new utilities, don't hesitate to create a new issue.\n\n\n## Utilities\n\n* **DispatchTimer** - A repeating timer that fires according to a static interval, e.g. \"Fire every 5 seconds\".\n* **VariableTimer** - A repeating timer that allows you to vary the interval between firings, e.g. \"Fire according to the function `interval = 2 * count`.\" \n\n# Usage \n\n### Quick Start\n\n##### CocoaPods\n\nAdd the following to your Podfile:\n\n```ruby\npod 'Chronos-Swift'\n```\n##### Carthage \n\nAdd the following to your Cartfile:\n\n```ruby\ngithub \"comyarzaheri/Chronos-Swift\" \"master\"\n```\n\n### Using a Dispatch Timer\n\n```swift\nimport Chronos\n\nvar timer = DispatchTimer(interval: 0.25, closure: {\n            (timer: RepeatingTimer, count: Int) in\n                println(\"Execute repeating task here\")\n            })\n\n/** Starting the timer */\ntimer.start(true) // Fires timer immediately\n\n/** Pausing the timer */\ntimer.pause()\n\n/** Permanently canceling the timer */\ntimer.cancel()\n\n```\n\n### Using a Variable Timer\n\n```swift\nimport Chronos\n\nvar variableTimer: VariableTimer = VariableTimer(closure: { \n            (timer: RepeatingTimer, count: Int) -\u003e Void in\n                println(\"Execute repeating task here\")\n        }) {(timer: VariableTimer, count: Int) -\u003e Double in\n                return Double(2 * count) // Return interval according to function\n        }\n\n/** Starting the timer */\ntimer.start(true) // Fires timer immediately\n\n/** Pausing the timer */\ntimer.pause()\n\n/** Permanently canceling the timer */\ntimer.cancel()\n\n```\n\n# Requirements\n\n* iOS 8.0 or higher\n* OS X 10.10 or higher\n\n# License \n\nChronos is available under the [MIT License](LICENSE).\n\n# Contributors\n\n* [@comyar](https://github.com/comyar)\n* [@schun93](https://github.com/schun93)\n* [@tokorom](https://github.com/tokorom)\n* [@ggiampietro](https://github.com/ggiampietro)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomyar%2FChronos-Swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomyar%2FChronos-Swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomyar%2FChronos-Swift/lists"}