tic toc not working

조회 수: 9 (최근 30일)
Oscar Schyns
Oscar Schyns 2019년 6월 11일
댓글: Alex Mcaulley 2019년 6월 11일
Currently I am working with a for loop that takes quite some time to run. In order for me to manage my time better I created a simple algortime that predicts when the loop is finished.
tic
t1 = datetime('now');
for i = 1 : 5000
k = toc;
t1 + seconds((k*5000)/i)
end
The only problem is that it is not working, when i = 5000 the time printed should be equal to the current time but it is always current time minus many minutes. I think this is because when my laptop is in lock screen mode the loop is still running but toc is not. is this true? And if yes is there a way to solve this problem.
Thanks,
Oscar
  댓글 수: 5
Oscar Schyns
Oscar Schyns 2019년 6월 11일
Was your computer in lock screen / dark screen mode because I think that is the reason why it is not working?
Alex Mcaulley
Alex Mcaulley 2019년 6월 11일
With the computer in lock screen mode I get the same result.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by