classdef HostTimer < coder.profile.Timer
% HOSTTIMER is a Timer subclass to get timing information for the application
% running on the host

% Copyright 2009-2016 The MathWorks, Inc.

methods

% constructor
function this = HostTimer()
% Initializes the properties of the timer class

this.setTimerDataType('uint64');

% ticks per second depends on the CPU clock frequency; it is valid to leave this
% empty
this.setTicksPerSecond([]);

[ timerSourceFile, headerFile, timerFunction, dataType ] = ...
coder.profile.getHostTimerInfo();

% Explicitly add the parentheses
readTimerExpr = sprintf('%s()', timerFunction);

this.setTimerDataType(dataType);
this.setSourceFile(timerSourceFile);
this.setHeaderFile(headerFile);
this.setReadTimerExpression(readTimerExpr);

% On all host platforms, the timer increments on each clock cycle
this.setCountDirection('up');
end
end
end