CellModules
TimeConvert.hpp
Go to the documentation of this file.
1
6#ifndef TIMECONVERT
7#define TIMECONVERT
8
9namespace TimeConvert {
10
14 static const double mnInS = 60.;
15
19 static const double hInS = 3600.;
20
24 static const double hInMn = 60.;
25
32 static inline double sToMn(double s) { return s / mnInS; }
33
40 static inline double sToH(double s) { return s / hInS; }
41
48 static inline double mnToS(double mn) { return mn * mnInS; }
49
56 static inline double mnToH(double mn) { return mn / hInMn; }
57
64 static inline double hToS(double h) { return h * hInS; }
65
72 static inline double hToMn(double h) { return h * hInMn; }
73
74} // namespace TimeConvert
75
76#endif
static const double mnInS
Number of seconds in a minute.
Definition: TimeConvert.hpp:14
static double hToMn(double h)
Converts hours to minutes.
Definition: TimeConvert.hpp:72
static const double hInMn
Number of minutes in an hour.
Definition: TimeConvert.hpp:24
static const double hInS
Number of seconds in an hour.
Definition: TimeConvert.hpp:19
static double sToMn(double s)
Converts seconds to minutes.
Definition: TimeConvert.hpp:32
static double hToS(double h)
Converts hours to seconds.
Definition: TimeConvert.hpp:64
static double mnToH(double mn)
Converts minutes to hours.
Definition: TimeConvert.hpp:56
static double sToH(double s)
Converts seconds to hours.
Definition: TimeConvert.hpp:40
static double mnToS(double mn)
Converts minutes to seconds.
Definition: TimeConvert.hpp:48