[TOC]

toc

Stop the internal timer

Usages

toc

dt = toc

toc(t)

dt = toc(t)

Examples

Input
tic
% Each of the matrices has 1,000,000 entries.
a = rand(1000,1000);
b = rand(1000,1000);
% Time taken to create the matrices.
toc
C = a'.*b';
% Time taken to create the matrices and to perform the multiplication.
toc
Output
Time elapsed: 3.077404e-02 seconds.

Time elapsed: 8.709546e-01 seconds.
Input
clear
t = zeros(1,100);
for n = 1:100
    a = rand(n,n);
    b = rand(n,1);
    tic;
    x = a\b;
    t(n) = toc;
end
plot(t)
xlabel('n');
ylabel('Time needed');
title('Time required to solve a system of n linear equations')
Output

toc