Lyric v1.6.0

std.os

platform function

pub fn platform(): string

stdlib/std/os.lyr:9

env function

pub fn env(name: string): ?string

stdlib/std/os.lyr:13

currentDir function

pub fn currentDir(): string

stdlib/std/os.lyr:16

exit function

pub fn exit(code: int): void

stdlib/std/os.lyr:21

args function

pub fn args(): string[]

The command-line arguments, also outside main.

main(args) receives them, but a function deeper in the program does not; here they are available without threading them through.

stdlib/std/os.lyr:29

setEnv function

pub fn setEnv(name: string, value: string): bool

Sets an environment variable for this process. Child processes inherit it; the system does not.

stdlib/std/os.lyr:33

hostName function

pub fn hostName(): ?string

stdlib/std/os.lyr:35

userName function

pub fn userName(): ?string

stdlib/std/os.lyr:36

homeDir function

pub fn homeDir(): ?string

stdlib/std/os.lyr:37

cpuCount function

pub fn cpuCount(): int

How many cores the machine has, for programs that split their work. The VM itself is single-threaded.

stdlib/std/os.lyr:41

nowMillis function

pub fn nowMillis(): int

Milliseconds since 1970-01-01 UTC.

A number rather than a date type: dates, time zones and calendars are their own module. The number is the same on every platform.

stdlib/std/os.lyr:47

nowNanos function

pub fn nowNanos(): int

Nanoseconds from a monotonic clock. Not comparable with nowMillis; the origin is arbitrary. A system clock can jump during a measurement, a monotonic one cannot.

stdlib/std/os.lyr:51

sleep function

pub fn sleep(millis: int): void

Suspends the process. The VM is single-threaded, so nothing runs alongside.

stdlib/std/os.lyr:54

envOr function

pub fn envOr(name: string, fallback: string): string

An environment variable with a default.

stdlib/std/os.lyr:59