Content deleted Content added
a little too fast |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1:
-- module timing individual functions
-- @license (CC-BY-SA-3.0)
-- @copyright John Erling Blad <jeblad@gmail.com>
-- @var The table holding this modules exported members
Line 111 ⟶ 112:
}
return table.concat(strings, '')
return nil
end
Line 119 ⟶ 126:
-- @return string describing the result
__call = function (self, func, ...)
-- resolve to the same level
local f1 = p.nop
local f2 = func
-- start the clock
local tick = os.clock()
▲ -- a dummy function that is used for a baseline measure
▲ function dummy()
▲ return nil
▲ end
▲ local baseline = self.stats( self.runner(dummy, ...) )
▲ local actual = self.stats( self.runner(func, ...) )
local combined = self.combine(baseline, actual)
|