47 int id = rhs[0].toInt();
48 string method(rhs[1].toString());
51 if (method ==
"new") {
59 else if (method ==
"getTickCount") {
64 else if (method ==
"getTickFrequency") {
69 else if (method ==
"getCPUTickCount") {
79 if (method ==
"delete") {
84 else if (method ==
"start") {
88 else if (method ==
"stop") {
92 else if (method ==
"reset") {
96 else if (method ==
"get") {
98 string prop(rhs[2].toString());
99 if (prop ==
"TimeTicks")
101 else if (prop ==
"TimeMicro")
103 else if (prop ==
"TimeMilli")
105 else if (prop ==
"TimeSec")
107 else if (prop ==
"Counter")
111 "Unrecognized property %s", prop.
c_str());
115 "Unrecognized operation %s", method.
c_str());
MxArray toMxArray(int64_t i)
MxArray constructor from 64-bit integer.
int64 getTimeTicks() const
double getTickFrequency()
LIBMWMEX_API_EXTERN_C void mexLock(void)
Lock a MEX-function so that it cannot be cleared from memory.
int last_id
Last object id to allocate.
struct mxArray_tag mxArray
Forward declaration for mxArray.
void set(mwIndex index, const T &value)
Template for numeric array element write accessor.
double getTimeMicro() const
map< int, Ptr< TickMeter > > obj_
Object container.
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
#define mxCreateNumericMatrix
LIBMWMEX_API_EXTERN_C void mexUnlock(void)
Unlock a locked MEX-function so that it can be cleared from memory.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
Global constant definitions.
double getTimeSec() const
double getTimeMilli() const
bool isNull() const
Determine whether the array is initialized or not.
Identifies a numeric mxArray whose data is stored as the type specified in the MATLAB Primitive Types...
Identifies an mxArray with no imaginary components.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.