Changeset 0f56058 for src/libcfa/time
- Timestamp:
- Apr 10, 2018, 5:50:27 PM (8 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:
- 2ae8507a
- Parents:
- 8ad6533
- File:
-
- 1 edited
-
src/libcfa/time (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/time
r8ad6533 r0f56058 10 10 // Created On : Wed Mar 14 23:18:57 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 9 13:10:23201813 // Update Count : 6 1612 // Last Modified On : Tue Apr 10 17:25:34 2018 13 // Update Count : 622 14 14 // 15 15 … … 27 27 enum { TIMEGRAN = 1_000_000_000LL }; // nanosecond granularity, except for timeval 28 28 29 #include <time_t.h> // Duration (constructors) / Time (constructors) 29 30 30 31 //######################### Duration ######################### 31 32 32 struct Duration { // private33 int64_t tv; // nanoseconds34 }; // Duration35 36 static inline void ?{}( Duration & dur ) with( dur ) { tv = 0; }37 static inline void ?{}( Duration & dur, Duration d ) with( dur ) { tv = d.tv; }38 39 static inline void ?{}( Duration & dur, zero_t ) with( dur ) { tv = 0; }40 33 static inline Duration ?=?( Duration & dur, zero_t ) { return dur{ 0 }; } 41 34 … … 155 148 //######################### Time ######################### 156 149 157 struct Time { // private158 uint64_t tv; // nanoseconds since UNIX epoch159 }; // Time160 161 static inline void ?{}( Time & t ) with( t ) { tv = 0; } // fast162 void ?{}( Time & time, int year, int month = 0, int day = 0, int hour = 0, int min = 0, int sec = 0, int nsec = 0 ); // slow163 164 static inline void ?{}( Time & t, zero_t ) { t.tv = 0; }165 150 static inline Time ?=?( Time & t, zero_t ) { return t{ 0 }; } 166 151 … … 247 232 } // resetClock 248 233 249 static inline void ?{}( Clock & clk ) { 250 resetClock( clk ); 251 } // Clock 252 253 static inline void ?{}( Clock & clk, Duration adj ) { 254 resetClock( clk, adj ); 255 } // Clock 234 static inline void ?{}( Clock & clk ) { resetClock( clk ); } 235 static inline void ?{}( Clock & clk, Duration adj ) { resetClock( clk, adj ); } 256 236 257 237 static inline Duration getRes() {
Note:
See TracChangeset
for help on using the changeset viewer.