Created
September 17, 2014 10:07
-
-
Save sinkovsky/66b7c988c6d9aaab752d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% | |
%% Convert seconds, minutes etc. to milliseconds. | |
%% | |
-spec seconds(Seconds) -> MilliSeconds when | |
Seconds :: non_neg_integer(), | |
MilliSeconds :: non_neg_integer(). | |
seconds(Seconds) -> | |
1000*Seconds. | |
-spec minutes(Minutes) -> MilliSeconds when | |
Minutes :: non_neg_integer(), | |
MilliSeconds :: non_neg_integer(). | |
minutes(Minutes) -> | |
1000*60*Minutes. | |
-spec hours(Hours) -> MilliSeconds when | |
Hours :: non_neg_integer(), | |
MilliSeconds :: non_neg_integer(). | |
hours(Hours) -> | |
1000*60*60*Hours. | |
-spec hms(Hours, Minutes, Seconds) -> MilliSeconds when | |
Hours :: non_neg_integer(), | |
Minutes :: non_neg_integer(), | |
Seconds :: non_neg_integer(), | |
MilliSeconds :: non_neg_integer(). | |
hms(H, M, S) -> | |
hours(H) + minutes(M) + seconds(S). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment