Estimated time analysis

A function that estimates the remaining and the total time inside loops.

Al momento, stai seguendo questo contributo

This function estimates the remaining and the total time of a for loop. The only arguments are the current and the last index(-ices) index of the for loop. When having multiple loops, it calculates the final estimate using the current inner loop timings. Therefore, in multiple loops it's indeed accurate when the outer loops perform the same number of iterations. The function prints by default the remaining and total time and also these values back.

In the current version the function only accounts for +1 incremental loops. In future versions there will be some extra options for considering more general loops as well. However, you can still use that for these loops as well with a proper assignment of the input arguments.

The current file has been massively tested in all the code I have written myself and works very well. However, there might be some printing "issues", depending on the Matlab version. In that case, please tell me so to fix it.

Example 1:
a = randi(10, 1000, 100) ;
tic
for i = 1 : 1000
eta(i, 1000) ;
s = sum(a(i, :)) ;
end
toc

Example 2:
a = randi(10, 20, 100) ;
tic
for i = 1 : 20
for j = 1 : 100
eta([i, j], [20, 100], true) ;
s = a(i, j) ^ 2 ;
end
end
toc

Cita come

Stratis Gavves (2026). Estimated time analysis (https://it.mathworks.com/matlabcentral/fileexchange/28667-estimated-time-analysis), MATLAB Central File Exchange. Recuperato .

Categorie

Scopri di più su Startup and Shutdown in Help Center e MATLAB Answers

Informazioni generali

Compatibilità della release di MATLAB

  • Compatibile con qualsiasi release

Compatibilità della piattaforma

  • Windows
  • macOS
  • Linux
Versione Pubblicato Note della release Action
1.0.0.0