function tstart = tic
%MATLAB Code Generation Library Function

% Limitations:
%
% 1. The output value differs in type from the MATLAB output. It should not be returned from a MEX
% file. The value returned from the MATLAB tic must not be passed to the codegen version of toc.
%
% 2. The state stored when calling toc is not shared between MATLAB and each separate MEX
% file. Calling tic in MATLAB and then toc in the MEX is not supported.
%
% 3. When generating code on Windows for MATLAB Host compatible hardware, the Windows high
% resolution timer APIs QueryPerformanceFrequency and QueryPerformanceCounter are used. In all other
% cases the POSIX timer API clock_gettime is used. When compiling generated code that uses the POSIX
% API, the preprocessor macro _POSIX_C_SOURCE must be defined to an integer greater than or equal to
% 199309L.
%
% 4. In code generation, when tic is called without a semicolon and without assigning the output,
% the return value will still be printed. So:
%
%   tic
%
% will print out ans = <returned timestamp>. In MATLAB that value would not have been printed. This
% includes calling tic inside of anonymous functions.

%   Copyright 2018-2019 The MathWorks, Inc.

%#codegen
coder.inline('never');
if nargout > 0
    tstart = coder.internal.time.getTime();
    return
end
coder.internal.time.impl.timeKeeper(coder.internal.time.getTime());

%--------------------------------------------------------------------------
