Module jls.lang.system
Provides access to data and operations of the underlying OS.
Access to environnement variables and default standard file handles. Operation such as the exit method and the garbage collection.
Functions
currentTime () | Returns the current time in seconds. |
currentTimeMillis () | Returns the current time in milliseconds. |
sleep (millis) | Causes the program to sleep. |
exit (code) | Terminates the program and returns a value to the OS. |
getenv (name) | Gets a specific environnement property. |
getArguments () | Returns the arguments used when calling the Lua standalone executable. |
gc () | Runs the garbage collector. |
Fields
lineSeparator | The Operating System (OS) line separator, '\n' on Unix and '\r\n' on Windows. |
input | The standard input stream file descriptor. |
output | The standard output stream file descriptor. |
error | The standard error stream file descriptor. |
Functions
- currentTime ()
-
Returns the current time in seconds.
The time is given as the number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
Returns:
-
the current time in seconds.
- currentTimeMillis ()
-
Returns the current time in milliseconds.
Returns:
-
The current time in milliseconds.
- sleep (millis)
-
Causes the program to sleep.
Parameters:
- millis The length of time to sleep in milliseconds.
- exit (code)
-
Terminates the program and returns a value to the OS.
Parameters:
- code The exit code to return to the OS.
- getenv (name)
-
Gets a specific environnement property.
Parameters:
- name The name of the property to get.
Returns:
-
The environnement property.
- getArguments ()
-
Returns the arguments used when calling the Lua standalone executable.
Returns:
-
table
The arguments.
- gc ()
- Runs the garbage collector.