-
-
Save rphillips/987bfb68618974371a16 to your computer and use it in GitHub Desktop.
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 Emitter = require('core').Emitter | |
local count = 12000000 | |
local o = Emitter:extend() | |
function o:initialize() | |
self.i = 0 | |
end | |
function o:blah() | |
self.i = self.i + 1 | |
end | |
function o:p() | |
return self.i | |
end | |
local start = os.clock() | |
local ctx | |
for i=1, count do | |
ctx = o:new() | |
ctx:blah() | |
ctx:p() | |
end | |
local e = os.clock() | |
p(count / (e - start)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment