Skip to main content

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​

ReturnsNameDescription
booleanIsEntityValidReturns if an entity is valid
BenchmarkBenchmarks a function performance

IsEntityValid​

Returns if an entity is valid

— Returns boolean (if the entity is valid).

local ret = HELIXUtils.IsEntityValid(entity)
TypeParameterDefaultDescription
anyentityEntity to verify

Benchmark​

Benchmarks a function performance, outputs in the console the elapsed time

HELIXUtils.Benchmark(name, amount, func, args...)
TypeParameterDefaultDescription
stringnameBenchmark name to output
numberamountAmount of times to loop
functionfuncThe function to call
anyargs...The arguments of the function to call