utils
Functions:
clock
utils.clock(): number
Returns the program running time (milliseconds).
run_timer
utils.run_timer(delay: number, period: number, callback: function[, ...]): number
delay
number
Initial delay before executing the callback function in seconds
period
number
Interval time between executing callback functions in seconds
callback
function
Lua function to execute
...
any
Additional arguments that will be passed to the callback function
Creates a timer for repeated execution. Returns a task ID.
run_timer_once
utils.run_timer_once(delay: number, callback: function[, ...]): number
delay
number
Delay before executing the callback function in seconds
callback
function
Lua function to execute
...
any
Additional arguments that will be passed to the callback function
Create a single execution timer. Returns a task ID.
cancel_timer
utils.cancel_timer(taskid: number): boolean
taskid
number
Task ID to be cancelled
Cancels the specified timer task. Returns false
only when an exception is thrown.
get_all_perf
utils.get_all_perf(): perf_data
Gets all performance data, including servers, Java and system information.. Returns a perf_data
table containing this data.
get_server_perf
utils.get_server_perf(): table
Gets server performance data. Returns a table
containing this data.
get_java_perf
utils.get_java_perf(): table
Gets Java performance data. Returns a table
containing this data.
get_system_perf
utils.get_system_perf(): table
Gets system performance data. Returns a table
containing this data.
get_tps
utils.get_tps(): table
Get the tick of the server per second. Returns a table
containing three number
values. They are the average TPS within 1, 5, and 15 minutes.
Structs:
⚡ perf_data
perf_data
Last updated