{"id":13507727,"url":"https://github.com/adamkittelson/block_timer","last_synced_at":"2025-10-21T15:18:13.462Z","repository":{"id":19090851,"uuid":"22318731","full_name":"adamkittelson/block_timer","owner":"adamkittelson","description":"Macros to use :timer.apply_after and :timer.apply_interval with a block","archived":false,"fork":false,"pushed_at":"2014-11-01T17:23:05.000Z","size":196,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-19T22:49:37.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/adamkittelson.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":"2014-07-27T18:42:50.000Z","updated_at":"2023-09-01T08:46:10.000Z","dependencies_parsed_at":"2022-09-26T22:10:25.205Z","dependency_job_id":null,"html_url":"https://github.com/adamkittelson/block_timer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkittelson%2Fblock_timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkittelson%2Fblock_timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkittelson%2Fblock_timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkittelson%2Fblock_timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamkittelson","download_url":"https://codeload.github.com/adamkittelson/block_timer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301963,"owners_count":20755512,"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-08-01T02:00:38.272Z","updated_at":"2025-10-21T15:18:13.345Z","avatar_url":"https://github.com/adamkittelson.png","language":"Elixir","readme":"[![Build Status](https://travis-ci.org/adamkittelson/block_timer.svg?branch=master)](https://travis-ci.org/adamkittelson/block_timer)\n\nBlockTimer\n=====\n\nMacros to use :timer.apply_after and :timer.apply_interval with a block, e.g.:\n\n  ```elixir\n    iex(1)\u003e import BlockTimer\n    nil\n    iex(2)\u003e apply_after 3 |\u003e seconds, do: IO.puts \"hello\"\n    {:ok, {1407446427626194, #Reference\u003c0.0.0.371\u003e}}\n    iex(3)\u003e hello\n  ```\n\n  ```elixir\n    iex(1)\u003e import BlockTimer\n    nil\n    iex(2)\u003e {:ok, counter} = Agent.start_link fn -\u003e 0 end\n    {:ok, #PID\u003c0.70.0\u003e}\n    iex(3)\u003e {:ok, tref} = apply_interval 1 |\u003e seconds do\n    ...(3)\u003e Agent.update(counter, fn(count) -\u003e count + 1 end)\n    ...(3)\u003e IO.puts Agent.get(counter, fn(count) -\u003e count end)\n    ...(3)\u003e end\n    {:ok, {:interval, #Reference\u003c0.0.0.382\u003e}}\n    iex(4)\u003e 1\n    2\n    3\n    4\n    5\n    :timer.cancel tref\n    {:ok, :cancel}\n    iex(5)\u003e\n  ```\n","funding_links":[],"categories":["Date and Time"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamkittelson%2Fblock_timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamkittelson%2Fblock_timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamkittelson%2Fblock_timer/lists"}