annotate DL/RLS-DLA/private/secs2hms.m @ 63:e08af264ef93

(none)
author idamnjanovic
date Tue, 15 Mar 2011 12:23:35 +0000
parents ad36f80e2ccf
children
rev   line source
idamnjanovic@60 1 function [h,m,s] = secs2hms(t)
idamnjanovic@60 2 %SECS2HMS Convert seconds to hours, minutes and seconds.
idamnjanovic@60 3 % [H,M,S] = SECS2HMS(T) converts the specified number of seconds T to
idamnjanovic@60 4 % hours, minutes and seconds. H and M are whole numbers, and S is real.
idamnjanovic@60 5 %
idamnjanovic@60 6 % Example: Estimate the remaining time of a loop
idamnjanovic@60 7 %
idamnjanovic@60 8 % n = 10; tic;
idamnjanovic@60 9 % for i = 1:n
idamnjanovic@60 10 % pause(1);
idamnjanovic@60 11 % [h,m,s] = secs2hms( (n-i)*toc/i );
idamnjanovic@60 12 % printf('estimated remaining time: %02d:%02d:%05.2f',h,m,s);
idamnjanovic@60 13 % end
idamnjanovic@60 14
idamnjanovic@60 15
idamnjanovic@60 16 % Ron Rubinstein
idamnjanovic@60 17 % Computer Science Department
idamnjanovic@60 18 % Technion, Haifa 32000 Israel
idamnjanovic@60 19 % ronrubin@cs
idamnjanovic@60 20 %
idamnjanovic@60 21 % April 2008
idamnjanovic@60 22
idamnjanovic@60 23
idamnjanovic@60 24 s = t;
idamnjanovic@60 25 h = fix(s/3600);
idamnjanovic@60 26 s = rem(s,3600);
idamnjanovic@60 27 m = fix(s/60);
idamnjanovic@60 28 s = rem(s,60);