mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
15 lines
318 B
Elixir
15 lines
318 B
Elixir
defmodule PhilomenaWeb.LayoutView do
|
|
use PhilomenaWeb, :view
|
|
|
|
def render_time(conn) do
|
|
(Time.diff(Time.utc_now(), conn.assigns[:start_time], :microsecond) / 1000.0)
|
|
|> Float.round(3)
|
|
|> Float.to_string()
|
|
end
|
|
|
|
def hostname() do
|
|
{:ok, host} = :inet.gethostname()
|
|
|
|
host |> to_string
|
|
end
|
|
end
|