
x = rand(1,10000);

tic
sum(x)
toc

tic
y = 0;
for i=x
    y = i+y;
end

y
toc