System

The System class provides static functions to interact with the system.

Static Functions

Terminates the program with a given exit code.

call Sparkle's System's exit with just 0

It is available as a macro.

exit 0

A function that throws a runtime error if the condition is false.

let name be "Alice"
call Sparkle's Terminal's assert with just name != "Bob"

It is available as a macro.

let name be "Alice"
assert name != "Bob"

Pauses execution of the program by a set amount of milliseconds

call Sparkle's System's sleep with just 5000

It is available as a macro.

sleep 5000

Runs a shell command and returns an object with an output and an error.

let result be call Sparkle's System's shell with just "ls"

if result's output is not equal to blank do
  print result's output
otherwise
  print "error: {result's error}"

Returns the number of nanoseconds since 1st January, 1970, 00:00:00 UTC.

let now be call Sparkle's Time's get_epoch_nanoseconds
print "The current time is {now}"