Changeset 9f652a1
- Timestamp:
- Apr 3, 2018, 9:19:21 PM (5 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- bb37870
- Parents:
- 8eb2018
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/time
r8eb2018 r9f652a1 10 10 // Created On : Wed Mar 14 23:18:57 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Apr 1 20:03:16201813 // Update Count : 58 112 // Last Modified On : Tue Apr 3 08:46:08 2018 13 // Update Count : 585 14 14 // 15 15 … … 113 113 114 114 static inline Duration ?%?( Duration lhs, Duration rhs ) { return (Duration)@{ lhs.tv % rhs.tv }; } 115 static inline Duration ?%=?( Duration & lhs, Duration rhs ) { lhs = lhs % rhs; return lhs; } 115 116 116 117 static inline _Bool ?==?( Duration lhs, Duration rhs ) { return lhs.tv == rhs.tv; } … … 139 140 static inline Duration ?`m ( int64_t min ) { return (Duration)@{ min * (60LL * TIMEGRAN) }; } 140 141 static inline Duration ?`m ( double min ) { return (Duration)@{ min * (60LL * TIMEGRAN) }; } 141 static inline Duration ?`h ( int64_t hours ) { return (Duration)@{ hours * (3600LL * TIMEGRAN) }; } 142 static inline Duration ?`h ( double hours ) { return (Duration)@{ hours * (3600LL * TIMEGRAN) }; } 143 static inline Duration ?`d ( int64_t days ) { return (Duration)@{ days * (24LL * 3600LL * TIMEGRAN) }; } 144 static inline Duration ?`d ( double days ) { return (Duration)@{ days * (24LL * 3600LL * TIMEGRAN) }; } 145 static inline Duration ?`w ( int64_t weeks ) { return (Duration)@{ weeks * (7LL * 24LL * 3600LL * TIMEGRAN) }; } 146 //static inline Duration ?`f ( int64_t fortnight ) { return (Duration)@{ fortnight * (14LL * 24LL * 3600LL * TIMEGRAN) }; } 142 static inline Duration ?`h ( int64_t hours ) { return (Duration)@{ hours * (60LL * 60LL * TIMEGRAN) }; } 143 static inline Duration ?`h ( double hours ) { return (Duration)@{ hours * (60LL * 60LL * TIMEGRAN) }; } 144 static inline Duration ?`d ( int64_t days ) { return (Duration)@{ days * (24LL * 60LL * 60LL * TIMEGRAN) }; } 145 static inline Duration ?`d ( double days ) { return (Duration)@{ days * (24LL * 60LL * 60LL * TIMEGRAN) }; } 146 static inline Duration ?`w ( int64_t weeks ) { return (Duration)@{ weeks * (7LL * 24LL * 60LL * 60LL * TIMEGRAN) }; } 147 static inline Duration ?`w ( double weeks ) { return (Duration)@{ weeks * (7LL * 24LL * 60LL * 60LL * TIMEGRAN) }; } 148 //static inline Duration ?`f ( int64_t fortnight ) { return (Duration)@{ fortnight * (14LL * 24LL * 60LL * 60LL * TIMEGRAN) }; } 149 //static inline Duration ?`f ( double fortnight ) { return (Duration)@{ fortnight * (14LL * 24LL * 60LL * 60LL * TIMEGRAN) }; } 147 150 148 151 static inline int64_t ?`ns ( Duration dur ) { return dur.tv; } … … 151 154 static inline int64_t ?`s ( Duration dur ) { return dur.tv / TIMEGRAN; } 152 155 static inline int64_t ?`m ( Duration dur ) { return dur.tv / (60LL * TIMEGRAN); } 153 static inline int64_t ?`h ( Duration dur ) { return dur.tv / ( 3600LL * TIMEGRAN); }154 static inline int64_t ?`d ( Duration dur ) { return dur.tv / (24LL * 3600LL * TIMEGRAN); }155 static inline int64_t ?`w ( Duration dur ) { return dur.tv / (7LL * 24LL * 3600LL * TIMEGRAN); }156 static inline int64_t ?`f ( Duration dur ) { return dur.tv / (14LL * 24LL * 3600LL * TIMEGRAN); }156 static inline int64_t ?`h ( Duration dur ) { return dur.tv / (60LL * 60LL * TIMEGRAN); } 157 static inline int64_t ?`d ( Duration dur ) { return dur.tv / (24LL * 60LL * 60LL * TIMEGRAN); } 158 static inline int64_t ?`w ( Duration dur ) { return dur.tv / (7LL * 24LL * 60LL * 60LL * TIMEGRAN); } 159 static inline int64_t ?`f ( Duration dur ) { return dur.tv / (14LL * 24LL * 60LL * 60LL * TIMEGRAN); } 157 160 158 161 //------------------------- timeval (cont) -------------------------
Note: See TracChangeset
for help on using the changeset viewer.