HELIXUtils
A table containing useful and aux functions.
🗿Static Class
This is a Static Class. Access it's methods directly with
.
. It's not possible to spawn new instances.Examples​
local table = {
"my_key" = 123,
[2] = "my_value"
}
local dump_text = HELIXUtils.Dump(table)
Console.Log(dump_text)
-- Outputs Text
--[[
{
"my_key": 123,
2 = "my_value"
}
--]]
local arg1 = math.random()
local arg2 = math.random()
HELIXUtils.Benchmark("My Heavy Operation", 1000, function(param1, param2)
-- Do some heavy operations here
local result = param1 * param2
end, arg1, arg2)
-- Outputs Text: 'Benchmark 'My Heavy Operation' (x1000) took 1.5ms.'
Static Functions​
Returns | Name | Description | |
---|---|---|---|
boolean | IsEntityValid | Returns if an entity is valid | |
Benchmark | Benchmarks a function performance |
IsEntityValid
​
Returns if an entity is valid
— Returns boolean (if the entity is valid).
local ret = HELIXUtils.IsEntityValid(entity)
Type | Parameter | Default | Description |
---|---|---|---|
any | entity | Entity to verify |
Benchmark
​
Benchmarks a function performance, outputs in the console the elapsed time
HELIXUtils.Benchmark(name, amount, func, args...)