arch
arch returns the target CPU architecture as a native OsArch enum. It reflects the target this binary was compiled for, not a runtime guess.
Signature
arch(): OsArchtyrus
import { arch } from "tyrus:os";
import { OsArch } from "tyrus:os";
const currentArch: OsArch = arch();
if (currentArch === OsArch.Aarch64) {
print("running on an ARM64 target");
}OsArch Members
| Member | Meaning |
|---|---|
X86_64 | 64-bit x86 |
Aarch64 | 64-bit ARM |
X86 | 32-bit x86 |
Arm | 32-bit ARM |
Other | Any other target |
