12-26-2015, 11:19 PM
(This post was last modified: 12-26-2015, 11:19 PM by LogicParrot.)
local MyClass = {} function MyClass:new() local Obj = {} setmetatable(Obj, self) self.__index = self Obj.TestVar = math.random(50) return Obj end function MyClass:Test() local R = self.TestVar + 50 end local startTime = os.clock() local Constr = MyClass:new() local test = Constr.Test for I = 1, 1000000000 do test(Constr) end print(os.clock() - startTime);