Membrane.Time.to_code
You're seeing just the function
to_code
, go back to Membrane.Time module for more information.
Specs
Returns quoted code producing given amount time. Chosen unit is the biggest possible that doesn't involve precission loss.
Examples
iex> import Membrane.Time
iex> 10 |> milliseconds() |> to_code() |> Macro.to_string()
quote do 10 |> Membrane.Time.milliseconds() end |> Macro.to_string()
iex> 60_000_000 |> microseconds() |> to_code() |> Macro.to_string()
quote do Membrane.Time.minute() end |> Macro.to_string()
iex> 2 |> nanoseconds() |> to_code() |> Macro.to_string()
quote do 2 |> Membrane.Time.nanoseconds() end |> Macro.to_string()