Changeset eef8dfb for libcfa/src/time.hfa
- Timestamp:
- Jan 7, 2021, 2:55:57 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 58fe85a
- Parents:
- bdfc032 (diff), 44e37ef (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/time.hfa
rbdfc032 reef8dfb 10 10 // Created On : Wed Mar 14 23:18:57 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 6 12:50:16202013 // Update Count : 6 5312 // Last Modified On : Wed Jun 17 16:13:00 2020 13 // Update Count : 663 14 14 // 15 15 … … 20 20 21 21 #include <time.h> // timespec 22 extern "C" {23 22 #include <sys/time.h> // timeval 24 }25 23 #include <time_t.hfa> // Duration/Time types 26 24 … … 91 89 int64_t ?`w( Duration dur ) { return dur.tn / (7LL * 24LL * 60LL * 60LL * TIMEGRAN); } 92 90 91 double ?`dns( Duration dur ) { return dur.tn; } 92 double ?`dus( Duration dur ) { return dur.tn / ((double)TIMEGRAN / 1_000_000.); } 93 double ?`dms( Duration dur ) { return dur.tn / ((double)TIMEGRAN / 1_000.); } 94 double ?`ds( Duration dur ) { return dur.tn / (double)TIMEGRAN; } 95 double ?`dm( Duration dur ) { return dur.tn / (60. * TIMEGRAN); } 96 double ?`dh( Duration dur ) { return dur.tn / (60. * 60. * (double)TIMEGRAN); } 97 double ?`dd( Duration dur ) { return dur.tn / (24. * 60. * 60. * (double)TIMEGRAN); } 98 double ?`dw( Duration dur ) { return dur.tn / (7. * 24. * 60. * 60. * (double)TIMEGRAN); } 99 93 100 Duration max( Duration lhs, Duration rhs ) { return (lhs.tn < rhs.tn) ? rhs : lhs;} 94 101 Duration min( Duration lhs, Duration rhs ) { return !(rhs.tn < lhs.tn) ? lhs : rhs;} … … 191 198 } // dmy 192 199 193 size_t strftime( char * buf, size_t size, const char * fmt, Time time );200 size_t strftime( char buf[], size_t size, const char fmt[], Time time ); 194 201 195 202 //------------------------- timeval (cont) -------------------------
Note:
See TracChangeset
for help on using the changeset viewer.