
tic

n = 500000;
A = rand(n,1);
B = cumsum(A);
% 
% 
% B = zeros(n,1);
% B(1) = A(1);
% for i = 2:n
%   B(i) = B(i-1) + A(i);
% end

toc