     end
   end
 
+  defp now(), do: :os.system_time :milli_seconds
+  #defp now(), do: :erlang.monotonic_time :milli_seconds
+
   defp index(bin, ch) do
     case :binary.match(bin, <<ch>>) do
       :nomatch -> -1

  """
  def readch(pid, ch, timeout \\ @to) do
    Agent.get_and_update(pid, fn {nid, buf} ->
      now = :erlang.monotonic_time :milli_seconds
      index = index(buf, ch)
      size = byte_size(buf)
      dl =  now + timeout

  """
  def readn(pid, count, timeout \\ @to) do
    Agent.get_and_update(pid, fn {nid, buf} ->
      now = now()
      size = byte_size(buf)
      dl = now + timeout
      {res, head, tail} = read_n(nid, [buf], size, count, dl)
