{"id":21306558,"url":"https://github.com/techmdw/quicktick","last_synced_at":"2026-01-19T07:02:00.322Z","repository":{"id":244231655,"uuid":"814668378","full_name":"TechMDW/QuickTick","owner":"TechMDW","description":"QuickTick is a Go package for creating customizable clocks that can run at different speeds and update intervals. Ideal for simulations and testing.","archived":false,"fork":false,"pushed_at":"2024-06-18T11:08:46.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-13T05:40:33.466Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/TechMDW.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-13T13:09:24.000Z","updated_at":"2024-06-19T10:10:58.000Z","dependencies_parsed_at":"2024-06-13T14:54:09.936Z","dependency_job_id":"c11b0c07-9741-43a1-b290-c0a8c9617368","html_url":"https://github.com/TechMDW/QuickTick","commit_stats":null,"previous_names":["techmdw/quicktick"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/TechMDW/QuickTick","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechMDW%2FQuickTick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechMDW%2FQuickTick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechMDW%2FQuickTick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechMDW%2FQuickTick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechMDW","download_url":"https://codeload.github.com/TechMDW/QuickTick/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechMDW%2FQuickTick/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28562684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-21T16:24:33.080Z","updated_at":"2026-01-19T07:02:00.307Z","avatar_url":"https://github.com/TechMDW.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuickTick\n\nQuickTick is a Go package that provides a customizable clock implementation, allowing you to create clocks that can run faster or slower than real time based on a specified multiplier. This is useful for simulations and testing.\n\n## Features\n\n- **Customizable Time Multiplier:** Adjust the clock to run faster or slower than real time.\n- **Custom Update Intervals:** Set custom intervals for how often the clock updates.\n- **Context Integration:** Use contexts to control the lifecycle of the clock.\n- **Concurrency Safe:** Safely access and manipulate the clock from multiple goroutines.\n\n## Installation\n\nTo install QuickTick, use `go get`:\n\n```sh\ngo get github.com/TechMDW/QuickTick@latest\n```\n\n## Usage\n\n### Basic Usage\n\nCreate a new QuickTick clock with a multiplier. By default, the clock updates every millisecond.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\t\"github.com/TechMDW/QuickTick\"\n)\n\nfunc main() {\n\tmultiplier := 2.0\n\tclock := quicktick.New(multiplier)\n\tdefer clock.Stop()\n\n\ttime.Sleep(2 * time.Second)\n\tfmt.Println(\"Accelerated Time:\", clock.Now())\n}\n```\n\n### Custom Usage\n\nCreate a QuickTick clock with a custom start time and update interval.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\t\"github.com/TechMDW/QuickTick\"\n)\n\nfunc main() {\n\tstartTime := time.Now().Add(-1 * time.Hour)\n\tmultiplier := 1.5\n\tupdateInterval := 500 * time.Millisecond\n\tclock := quicktick.NewCustom(startTime, multiplier, updateInterval)\n\tdefer clock.Stop()\n\n\ttime.Sleep(2 * time.Second)\n\tfmt.Println(\"Accelerated Time:\", clock.Now())\n}\n```\n\n### Context Usage\n\nCreate a QuickTick clock that stops when the context is done.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\t\"github.com/TechMDW/QuickTick\"\n)\n\nfunc main() {\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tmultiplier := 2.0\n\tclock := quicktick.NewCtx(ctx, multiplier)\n\tdefer clock.Stop()\n\n\ttime.Sleep(2 * time.Second)\n\tfmt.Println(\"Accelerated Time:\", clock.Now())\n\tcancel()\n}\n```\n\n### Custom Context Usage\n\nCreate a QuickTick clock with a custom start time, multiplier, and update interval, controlled by a context.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\t\"github.com/TechMDW/QuickTick\"\n)\n\nfunc main() {\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tstartTime := time.Now().Add(-1 * time.Hour)\n\tmultiplier := 1.5\n\tupdateInterval := 500 * time.Millisecond\n\tclock := quicktick.NewCustomCtx(ctx, startTime, multiplier, updateInterval)\n\tdefer clock.Stop()\n\n\ttime.Sleep(2 * time.Second)\n\tfmt.Println(\"Accelerated Time:\", clock.Now())\n\tcancel()\n}\n```\n\n## Concurrency\n\nQuickTick is designed to be concurrency safe. You can safely access and manipulate the clock from multiple goroutines.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\t\"github.com/TechMDW/QuickTick\"\n)\n\nfunc main() {\n\tclock := quicktick.New(1.5)\n\tdefer clock.Stop()\n\n\tvar wg sync.WaitGroup\n\twg.Add(2)\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tfor i := 0; i \u003c 10; i++ {\n\t\t\tfmt.Println(\"Goroutine 1:\", clock.Now())\n\t\t\ttime.Sleep(100 * time.Millisecond)\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tfor i := 0; i \u003c 10; i++ {\n\t\t\tfmt.Println(\"Goroutine 2:\", clock.Now())\n\t\t\ttime.Sleep(100 * time.Millisecond)\n\t\t}\n\t}()\n\n\twg.Wait()\n}\n```\n\n## Testing\n\nQuickTick includes tests to ensure its functionality. Use the following command to run the tests:\n\n```sh\ngo test ./...\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\nThis README provides an overview of the QuickTick package, installation instructions, usage examples, concurrency considerations, and testing information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechmdw%2Fquicktick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechmdw%2Fquicktick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechmdw%2Fquicktick/lists"}