Skip to content
/ durex Public

Parse short time durations to their numerical value in milliseconds. e.g. "1s" -> 1000

License

Notifications You must be signed in to change notification settings

walkr/durex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Durex

Documentation

A small Elixir library for parsing durations, such as "1s", to its numerical millisecond value, e.g. 1_000.

Installation

def deps do
  [
    {:durex, "~> 0.1.0"}
  ]
end

Usage

# Success
{:ok, 1_000} = Durex.ms("1s")
{:ok, 500} = Durex.ms("0.5s")
500 = Durex.ms!("0.5s")

# Error
:error = Durex.ms("bla")

MIT License

About

Parse short time durations to their numerical value in milliseconds. e.g. "1s" -> 1000

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages