%% Compute Elapsed Time
% Compute the time elapsed between a specified time and the current time.
% Specify the initial date and time as the start of January 2020. Convert it to date vector form.

t1 = datevec('2020-01-01')

%
% Determine the current date and time. The clock function returns the current date and time as a date vector.

t2 = clock

%
% You can compute the number of seconds between t1 and t2 by using etime.

e = etime(t2,t1)

%
% However, this method is not recommended for measuring the time it takes to run your code.
% Copyright 2015-2020 The MathWorks, Inc.