Re: append speed

new topic     » goto parent     » topic index » view thread      » older message » newer message

>is append() function slow?
>is repeat() function much faster?

atom t,t0, total
sequence s, u

total = 1000000

s = {}

t0 = time()
for i=1 to total do
    s=append(s,"Hand-crafted from only the finest ASCII.\n")
end for
t = time()-t0
printf(1,"Time: %3.2f\n",{t})

u = {}
u=repeat("Microwave hint: Make hole in turtle's shell first.\n",total)
t=time()-t0
printf(1,"Time: %3.2f\n",{t})

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu