{"id":21815270,"url":"https://github.com/ericbatlle/timer","last_synced_at":"2025-03-21T09:45:50.725Z","repository":{"id":262259024,"uuid":"886398541","full_name":"EricBatlle/Timer","owner":"EricBatlle","description":"Unity Freezable Timer","archived":false,"fork":false,"pushed_at":"2025-01-03T01:15:38.000Z","size":6062,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T03:46:18.618Z","etag":null,"topics":["freezable","timer","timers","unity","unitytime"],"latest_commit_sha":null,"homepage":"","language":"ShaderLab","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/EricBatlle.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-11-10T22:13:28.000Z","updated_at":"2025-01-03T01:15:42.000Z","dependencies_parsed_at":"2024-11-11T13:48:51.487Z","dependency_job_id":null,"html_url":"https://github.com/EricBatlle/Timer","commit_stats":null,"previous_names":["ericbatlle/timer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricBatlle%2FTimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricBatlle%2FTimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricBatlle%2FTimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricBatlle%2FTimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EricBatlle","download_url":"https://codeload.github.com/EricBatlle/Timer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244776273,"owners_count":20508503,"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":["freezable","timer","timers","unity","unitytime"],"created_at":"2024-11-27T15:17:11.959Z","updated_at":"2025-03-21T09:45:50.706Z","avatar_url":"https://github.com/EricBatlle.png","language":"ShaderLab","funding_links":["https://www.buymeacoffee.com/ebatlleclavero","https://github.com/sponsors/EricBatlle","https://paypal.me/EricBatlleClavero?locale.x=es_ES"],"categories":[],"sub_categories":[],"readme":"# Timer ⏲️\n*Created by Eric Batlle Clavero*\n\nCustom **Timer** made with **Unity** but that can also work outside Unity environment, fully tested and independent of Time.deltaTime or similar.\n\n*I noticed that in many projects, it's common to track elapsed time by adding Time.deltaTime (or something similar) in an Update loop to keep track of how much time has passed. \nThis approach can make games hard to test, as time becomes dependent on scene-time ticks. \nAn alternative approach is to simply record the start and end times and calculate the difference, without adding anything incrementally.\nAnd that's what this timer does.*\n\n## Features ⏱️\n- Reset Timer\n- Stop Timer\n- Start Timer\n- Pause Timer\n- Resume Timer\n- **Freeze** Timer\n\n## Freeze 🥶\nThe timer can be frozen for a specified duration. \nWhile frozen, the timer’s original duration remains paused.\nTimer can be paused while freezed, and after resume the pause, freeze timer time will run, then the original time.\n\nCheck the example video below for better understanding.\n\n## Example 🎬\n\u003cp\u003e\n  \u003cimg src=\"TimerExample.gif\" alt=\"simple video gif\" width=\"206\" height=\"270\"/\u003e\n\u003c/p\u003e\n\n*This video demonstrates a SampleScene containing a TimerView that showcases pausing, freezing, and both in combination.*\n\n## Donations are appreciated! 💸\n*Remember that are many ways to say thank you.*\n\nIf this timer has been helpful, remember to star the repository and consider buying me a coffee! 😀 \n\u003cp\u003e\n\u003ca href=\"https://www.buymeacoffee.com/ebatlleclavero\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-blue.png\" alt=\"Buy Me A Coffee\" width=\"144.6\" height=\"34\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nIf you like my general work and contributions consider [sponsoring me on Github](https://github.com/sponsors/EricBatlle). \n\nBut if you just want to donate straightforward, I also have [PayPal.me](https://paypal.me/EricBatlleClavero?locale.x=es_ES).\n\n## How to Install :hammer_and_wrench:\t\n- If you want to install the whole project and check the sample scene and the code, you'll need to have **Unity** installed and updated\n- After that you can just download and open the repository folder with Unity editor\n\n## How to Use ⚙️\n- Inside the Assets folder there are 2 folders, **SampleScene** and **Timer**\n- **SampleScene** contains the scene visible in the example video\n- **Timer** contains the **TimerModule** code\n  \n#### How to use the SampleScene:\n- Just play the **SampleScene** scene, and click on the buttons to see how timer works\n- Remember that you can specify different times for Timer and Freeze duration with the InputFields next to the buttons of Start Timer and Freeze Timer\n\n#### How to use the Timer code:\n*Tip: Review the ``Bootstrap.cs `` class for a better understanding.*\n\n- **Timer** is just an entity class, it contains only data, and no business logic related\n- **TimerService** is the opposite, is a service that provides functionalities to interact with a **Timer**, and it's dependant on **IDateTimeProvider**\n- **IDateTimeProvider** and **DateTimeProvider** are the abstractions I used to get the current [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) time. This is very useful to later Substitute the interface and be able to provide times on demanding.\n\nIn summary, if you want to use **Timer** in your project, be sure to initialize the service **TimerService** and the provider **DateTimeProvider**.\nAfter that you only need to call:\n\n``var timer = new Timer(TimeSpan.FromSeconds(X)); // being X the ammount of time duration for your timer``\n\nAnd to give orders to that timer, use the Service, for example to freeze that timer, you only need to do the following:\n\n``timerService.FreezeTimer(timer, TimeSpan.FromSeconds(Y) // being Y the ammount of freezing time duration for your timer``\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericbatlle%2Ftimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericbatlle%2Ftimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericbatlle%2Ftimer/lists"}