简体   繁体   中英

Elixir/Erlang - Nanosleep

Is there an nanosleep for Elixir/Erlang out there? Erlangs timer.sleep does "only" take milliseconds and Im looking for a shorter sleep than that.

I ended up in doing something like this:

defmodule TimeCheck do
  def time_ok(time) do
    if :erlang.system_time - time < 10000 do
      TimeCheck.time_ok(time)
    else
      true
    end
  end
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM