os
Platform info, environment, sleep, exit.
benutzen "os".
Functions
Environment variables, working directory, sleep, and process exit.
| Symbol | Description | Example |
|---|---|---|
cwd() | Current working directory | benutzen "os";
print os::cwd(); |
platform() | macos / linux / windows | benutzen "os";
print os::platform(); |
env(name) | Environment variable or nil | benutzen "os";
print os::env("HOME"); |
time() | Unix timestamp (seconds) | benutzen "os";
print os::time(); |
clock() | Process CPU time (seconds) | benutzen "os";
print os::clock(); |
sleep(ms) | Sleep milliseconds | benutzen "os";
os::sleep(100); |
exit(code) | Terminate process | benutzen "os";
os::exit(0); |