lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


you can use this for all of your performance related questions :D

benchMark=function(turns, ...) -- (1000000, {func1, {params...}},
{func2, {params...}}, ...)
  local res={}
  for i=1, select('#', ...) do
    local current=select(i, ...)
    local start=os.time()
    for j=1, turns do
      current[1](unpack(current[2])) end
    res[i]=os.difftime(os.time(), start) end
  return res end