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