gleam/os

Function to interact with the host operating system.

Types

TimeUnit

pub type TimeUnit {
  Second
  Millisecond
  Microsecond
  Nanosecond
}

Constructors

  • Second
  • Millisecond
  • Microsecond
  • Nanosecond

Functions

delete_env

pub fn delete_env(key: String) -> Nil

Delete an environment variable.

erlang_timestamp

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

Return the current OS system time as a tuple of Ints

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

get_env

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

Return all environment variables set on the system.

insert_env

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

Set an environment variable.

system_time

pub external fn system_time(TimeUnit) -> Int

Return the current OS system time.

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