Skip to content

Commit d26bda0

Browse files
committed
feat: add comprehensive time conversion constants
1 parent 745a597 commit d26bda0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

include/time_shield_cpp/parts/constants.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,42 @@ namespace time_shield {
3636
// Microseconds and milliseconds
3737
constexpr int64_t US_PER_SEC = 1000000; ///< Microseconds per second
3838
constexpr int64_t MS_PER_SEC = 1000; ///< Milliseconds per second
39+
constexpr int64_t MS_PER_1_SEC = 1000; ///< Milliseconds per 1 second
3940
constexpr int64_t MS_PER_5_SEC = 5000; ///< Milliseconds per 5 second
4041
constexpr int64_t MS_PER_10_SEC = 5000; ///< Milliseconds per 10 second
4142
constexpr int64_t MS_PER_15_SEC = 15000; ///< Milliseconds per 15 second
4243
constexpr int64_t MS_PER_30_SEC = 30000; ///< Milliseconds per 30 second
4344
constexpr int64_t MS_PER_MIN = 60000; ///< Milliseconds per minute
45+
constexpr int64_t MS_PER_1_MIN = 60000; ///< Milliseconds per 1 minute
4446
constexpr int64_t MS_PER_5_MIN = 300000; ///< Milliseconds per 5 minute
4547
constexpr int64_t MS_PER_10_MIN = 600000; ///< Milliseconds per 10 minute
4648
constexpr int64_t MS_PER_15_MIN = 900000; ///< Milliseconds per 15 minute
4749
constexpr int64_t MS_PER_30_MIN = 1800000; ///< Milliseconds per 30 minute
4850
constexpr int64_t MS_PER_HALF_HOUR = 1800000; ///< Milliseconds per half hour
4951
constexpr int64_t MS_PER_HOUR = 3600000; ///< Milliseconds per hour
52+
constexpr int64_t MS_PER_1_HOUR = 3600000; ///< Milliseconds per 1 hour
53+
constexpr int64_t MS_PER_2_HOUR = 7200000; ///< Milliseconds per 2 hour
54+
constexpr int64_t MS_PER_4_HOUR = 14400000; ///< Milliseconds per 4 hour
55+
constexpr int64_t MS_PER_5_HOUR = 18000000; ///< Milliseconds per 5 hour
56+
constexpr int64_t MS_PER_8_HOUR = 28800000; ///< Milliseconds per 8 hour
57+
constexpr int64_t MS_PER_12_HOUR = 43200000; ///< Milliseconds per 12 hour
5058
constexpr int64_t MS_PER_DAY = 86400000; ///< Milliseconds per day
5159

5260
// Seconds
5361
constexpr int64_t SEC_PER_MIN = 60; ///< Seconds per minute
62+
constexpr int64_t SEC_PER_1_MIN = 60; ///< Seconds per 1 minute
5463
constexpr int64_t SEC_PER_3_MIN = 180; ///< Seconds per 3 minute
5564
constexpr int64_t SEC_PER_5_MIN = 300; ///< Seconds per 5 minute
5665
constexpr int64_t SEC_PER_10_MIN = 600; ///< Seconds per 10 minute
5766
constexpr int64_t SEC_PER_15_MIN = 900; ///< Seconds per 15 minute
5867
constexpr int64_t SEC_PER_HALF_HOUR = 1800; ///< Seconds per half hour
5968
constexpr int64_t SEC_PER_HOUR = 3600; ///< Seconds per hour
69+
constexpr int64_t SEC_PER_1_HOUR = 3600; ///< Seconds per 1 hour
70+
constexpr int64_t SEC_PER_2_HOUR = 7200; ///< Seconds per 2 hour
71+
constexpr int64_t SEC_PER_4_HOUR = 14400; ///< Seconds per 4 hour
72+
constexpr int64_t SEC_PER_5_HOUR = 18000; ///< Seconds per 5 hour
73+
constexpr int64_t SEC_PER_8_HOUR = 28800; ///< Seconds per 8 hour
74+
constexpr int64_t SEC_PER_12_HOUR = 43200; ///< Seconds per 12 hour
6075
constexpr int64_t SEC_PER_DAY = 86400; ///< Seconds per day
6176
constexpr int64_t SEC_PER_YEAR = 31536000; ///< Seconds per year (365 days)
6277
constexpr int64_t AVG_SEC_PER_YEAR = 31557600; ///< Average seconds per year (365.25 days)
@@ -70,6 +85,7 @@ namespace time_shield {
7085
// Minutes
7186
constexpr int64_t MIN_PER_HOUR = 60; ///< Minutes per hour
7287
constexpr int64_t MIN_PER_DAY = 1440; ///< Minutes per day
88+
constexpr int64_t MIN_PER_1_DAY = 1440; ///< Minutes per 1 day
7389
constexpr int64_t MIN_PER_2_DAY = 2*1440; ///< Minutes per 2 day
7490
constexpr int64_t MIN_PER_5_DAY = 5*1440; ///< Minutes per 5 day
7591
constexpr int64_t MIN_PER_7_DAY = 7*1440; ///< Minutes per 7 day

0 commit comments

Comments
 (0)