Measure the time spent by a function

조회 수: 3 (최근 30일)
Lask
Lask 2017년 10월 17일
댓글: Lask 2017년 10월 18일
Hi everyone,
I have programmed a function in Matlab which calls a second function from a DLL which is programmed in C. For instance:
Matlab function: function A = myfunction{calls myDLLfunction}
DLL function in .dll file: function = myDLLfunction{does something}
I want to measure the time spent by myDLLfunction execution from Matlab. I tried the following:
tic
A = myfunction(calls myDLLfunction)
toc
but obviously, this only measures the time spent by myfunction calling myDLLfunction, not the actual time spent by myDLLfunction once it is called.
Any help would be appreciated.

답변 (2개)

KSSV
KSSV 2017년 10월 18일
You type tic and toc inside your myfunction.

Stephen23
Stephen23 2017년 10월 18일
편집: Stephen23 2017년 10월 18일
  댓글 수: 3
Jan
Jan 2017년 10월 18일
@E. Valero: The time for "calling" this function does mean the time, which is spent inside the function.
Lask
Lask 2017년 10월 18일
Hey Jan,
so even if the called function is in a DLL external to MATLAB, the time spent by calllib includes the execution time of that function?
Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Acquisition Toolbox Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by