https://github.com/d-exclaimation/timing
In case, you miss setTimeout and setInterval while using Elixir
https://github.com/d-exclaimation/timing
concurrency elixir loops non-blocking timer
Last synced: about 1 year ago
JSON representation
In case, you miss setTimeout and setInterval while using Elixir
- Host: GitHub
- URL: https://github.com/d-exclaimation/timing
- Owner: d-exclaimation
- License: apache-2.0
- Created: 2021-07-02T08:14:10.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-22T12:54:39.000Z (almost 5 years ago)
- Last Synced: 2024-12-29T12:39:04.900Z (over 1 year ago)
- Topics: concurrency, elixir, loops, non-blocking, timer
- Language: Elixir
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Timing
Wrapping Library to perform common timing callbacks
## Usage
Haven't made this to work with mix at all
### Manual
1. Clone / Copy all the files in a directory in your project
2. Add to supervision tree
```elixir
def start(_type, _args) do
children = [
# Timing function seperate thread task capabilities
{Timing.Supervisor, name: Timing.Supervisor},
]
# ... your stuff here
end
```
3. Use the Timing to perform setTimeout and setInterval etc
```elixir
ref = Timing.timeout(2000, fn ->
# ... Some stuff here
end)
# ...
Timing.clear(ref) # Cancel callback
```