Skip to content

Instantly share code, notes, and snippets.

@rphillips
Created November 17, 2014 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rphillips/987bfb68618974371a16 to your computer and use it in GitHub Desktop.
Save rphillips/987bfb68618974371a16 to your computer and use it in GitHub Desktop.
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