gleam/os

Function to interact with the host operating system.

Types

pub type TimeUnit {
  Second
  Millisecond
  Microsecond
  Nanosecond
}

Constructors

  • Second
  • Millisecond
  • Microsecond
  • Nanosecond

Functions

pub fn delete_env(key: String) -> Nil

Deletes an environment variable.

pub external fn erlang_timestamp() -> #(Int, Int, Int)

Returns the current OS system time as a tuple of Ints

http://erlang.org/doc/man/os.html#timestamp-0

pub fn get_env() -> Map(String, String)

Returns all environment variables set on the system.

pub fn insert_env(key: String, value: String) -> Nil

Sets an environment variable.

pub external fn system_time(TimeUnit) -> Int

Returns the current OS system time.

https://erlang.org/doc/apps/erts/time_correction.html#OS_System_Time