This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local curtime = os.nanotime | |
local results = {} | |
---@param iterations number | |
---@param title string | number | |
---@param func function | |
local function benchmark(iterations, title, func) | |
local start = curtime() | |
for i = 1, iterations do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ESX = exports.es_extended:getSharedObject() | |
local jobCount = {} | |
local function addJob(job) | |
jobCount[job.name] = (jobCount[job.name] or 0) + 1 | |
GlobalState[job.name] = jobCount[job.name] | |
end | |
local function playerLoaded(_, xPlayer) | |
local data = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ref: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Classes_in_JavaScript | |
-- Person Class | |
---@class Person : OxClass | |
---@field name string | |
local Person = lib.class('Person') | |
function Person:constructor(name) | |
print('calling Person constructor for', name) |