DisplayEstimatedTim​eOfLoop( tot_toc, curr_ix, tot_iter )

版本 1.6.0.0 (1.4 KB) 作者: Paulo Abelha
Displays the estimated time to finish a for loop
418.0 次下载
更新时间 2016/12/1

查看许可证

Gives you a formatted estimated time (HH:MM:SS) to finish your for loop. Simple to use.
USAGE:
% declare tot_toc
tot_toc = 0
for i=init_iter:tot_iter
% before anything, get tic
tic
% perform your computations
...
% at the end, call this function like this:
tot_toc = DisplayEstimatedTimeOfLoop( tot_toc+toc, i, tot_iter-init_iter );
end

引用格式

Paulo Abelha (2024). DisplayEstimatedTimeOfLoop( tot_toc, curr_ix, tot_iter ) (https://www.mathworks.com/matlabcentral/fileexchange/59187-displayestimatedtimeofloop-tot_toc-curr_ix-tot_iter), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.6.0.0

Fixed a typo in the title.

1.5.0.0

Added the possibility of inputting a prefix to be added at the beginning of the output string.

1.4.0.0

Now the function prints the total elapsed time at the end of the final iteration of the loop

1.3.0.0

Fixed usage typo

1.2.0.0

Updated description

1.1.0.0

Made the example usage more clear

1.0.0.0