필터 지우기
필터 지우기

cputime() related question

조회 수: 1 (최근 30일)
D_coder
D_coder 2020년 7월 15일
댓글: John D'Errico 2020년 7월 15일
Just a quick question
is there a difference between
t1 = cputitme();
t2 = cputime();
t = t2 - t1
and
t1 = cputtime();
t = cputime() - t1;
Both give different answers to me. In fact the second one is way faster for my program.
  댓글 수: 1
John D'Errico
John D'Errico 2020년 7월 15일
There is no significant difference, except that you have spelled it three different ways, so it is unlikely the code you wrote actually works. ;)
But what do you mean by one of those calls is faster than the other? cputime does not measure time well enough to clearly be able to tell you such a short time interval. Even the slightest variation of something running on your computer in the background will be enough to blow that tiny difference out of the water.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by