misc

Misc functions for a tinkering user.

uv.misc.version()

Get the current version of LibUV (as a integer)

Returns:A integer representing the current libuv version.
uv.misc.version_string()

Get the current version of LibUV (as a string)

Returns:A string representing the current libuv version.
uv.misc.get_process_title()

Get the current process title.

Returns:A string representing the current process title.
uv.misc.set_process_title(name)

Set the process title of the executable.

Arguments:
  • name (string) – The new process title.
uv.misc.resident_set_memory()

Get the resident set size for the current process.

Returns:A integer representing the resident set size
uv.misc.uptime()

Get the current system uptime

Returns:A integer representing the current system uptime (in milliseconds)
uv.misc.getrusage()

Get the current resource usage of the system.

Returns:An object containing various fields relating to resource usage.
uv.misc.cpu_info()

Get info on the processors on the host system.

object.model

Model of CPU.

object.speed

Speed of CPU.

object.times
Times for the CPU.
object.times.user

“User” times for the CPU.

object.times.nice

“Nice” times for the CPU.

object.times.sys

“Sys” times for the CPU.

object.times.idle

“Idle” times for the CPU.

object.times.irq

“IRQ” times for the CPU.

Returns:An array containing objects containing information about the processors in the host system.
uv.misc.interface_addresses()

Get the address, family, and port of the network interfaces on the host system.

object.name

Name of the network interface.

object.internal

Boolean representing if the object is an internal interface or not.

object.address

String representing the IPv4/IPv6 address of the interface.

object.protocol

String representing the protocol of the interface.

Returns:An array containing objects containing information about the network interfaces in the host.
uv.misc.loadavg()

Get the load average of the system.

Returns:An array containing three numbers representing the load averages of the system.
uv.misc.exepath()

Get the path to the running executable.

Returns:A string corresponding to the path of the current running executable.
uv.misc.cwd()

Get the current working directory.

Returns:A string corresponding to the current working directory.
uv.misc.os_homedir()

Get the home directory of the current logged in user.

Returns:A string corresponding to the home directory of the current user.
uv.misc.chdir(path)

Change the current working directory to the path.

Warning

Be sure to change the current working path to the Blockland/ directory, or else Torque will be fucked.

Arguments:
  • path (string) – The path to change the current working directory to.
uv.misc.get_total_memory()

Get the current memory of the system.

Returns:A number representing the total memory, in kilobytes.
uv.misc.hrtime()

Get the current high-resolution timestamp of the system.

Returns:A number representing the current high-resolution timestamp, in nanoseconds.
uv.misc.now()

Get a value corresponding to some value stored in the timer loop. This is relative to some random point in time in the past.

Returns:A number representing a timestamp.