%% Take Measurements Using Multiple tic Calls
% Use a pair of tic and toc calls to report the total time required for element-by-element matrix multiplication; use another pair to report the total runtime of your program.

tStart = tic;           % pair 2: tic
n = 10;
T = zeros(1,n);
for i = 1:n
    A = rand(12000,4400);
    B = rand(12000,4400);
    tic         % pair 1: tic
    C = A.*B;
    T(i)= toc;  % pair 1: toc
end
tMul = sum(T)
tEnd = toc(tStart)      % pair 2: toc

% The variable tMul includes the total time spent on multiplication. tEnd specifies the elapsed time since the call to the tic function at the beginning of the program.
% Copyright 2019 The MathWorks, Inc.