lua-users home
lua-l archive

Re: "String builder"-style optimization

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


it became broken, the {func2, {params...}}, ...) part is the end of
the first line, as it is only the usage...
2017年07月03日 21:30 GMT+02:00 szbnwer@gmail.com <szbnwer@gmail.com>:
> 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

AltStyle によって変換されたページ (->オリジナル) /