This class provides access to various base functions of system platforms. Look in the sys package for more system APIs.

Static methods

@:has_untypedstaticprintln(v:Dynamic):Void

Available on clay native, unity

Prints any value to the standard output, followed by a newline. On Windows, this function outputs a CRLF newline. LF newlines are printed on all other platforms.

@:has_untypedstaticargs():Array<String>

Returns all the arguments that were passed in the command line. This does not include the interpreter or the name of the program file.

(java)(eval) On Windows, non-ASCII Unicode arguments will not work correctly.

(cs) Non-ASCII Unicode arguments will not work correctly.

staticsleep(seconds:Float):Void

Available on clay native, unity

Suspends execution for the given length of time (in seconds).

staticgetCwd():String

Gets the current working directory (usually the one in which the program was started).

staticsetCwd(s:String):Void

Changes the current working directory.

(java) This functionality is not available on Java; calling this function will throw.

staticsystemName():String

Returns the type of the current system. Possible values are: - "Windows" - "Linux" - "BSD" - "Mac"

@:has_untypedstaticexit(code:Int):Void

Exits the current process with the given exit code.

(macro)(eval) Being invoked in a macro or eval context (e.g. with -x or --run) immediately terminates the compilation process, which also prevents the execution of any --next sections of compilation arguments.

statictime():Float

Available on clay native, unity

Gives the most precise timestamp value available (in seconds).

staticinlinegetEnv(s:String):String

Available on unity

Returns the value of the given environment variable, or null if it doesn't exist.

staticinlinecpuTime():Float

Available on unity

Gives the most precise timestamp value available (in seconds), but only accounts for the actual time spent running on the CPU for the current thread/process.