- Timestamp:
- Jun 30, 2018, 6:47:55 PM (6 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- fe3cd36
- Parents:
- 73de175
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/clock
r73de175 r22cf65e 10 10 // Created On : Thu Apr 12 14:36:06 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Apr 12 16:53:31201813 // Update Count : 312 // Last Modified On : Tue Jun 26 14:11:44 2018 13 // Update Count : 6 14 14 // 15 15 … … 40 40 static inline void resetClock( Clock & clk, Duration adj ) with( clk ) { 41 41 clocktype = -1; 42 offset = adj + timezone`s; // timezone (global) is (UTC - local time) in seconds42 offset = adj + __timezone`s; // timezone (global) is (UTC - local time) in seconds 43 43 } // resetClock 44 44 45 45 static inline void ?{}( Clock & clk ) { resetClock( clk ); } 46 46 static inline void ?{}( Clock & clk, Duration adj ) { resetClock( clk, adj ); } 47 48 static inline Duration getResNsec() { 49 struct timespec res; 50 clock_getres( CLOCK_REALTIME, &res ); 51 return ((int64_t)res.tv_sec * TIMEGRAN + res.tv_nsec)`ns; 52 } // getRes 47 53 48 54 static inline Duration getRes() { … … 54 60 static inline Time getTimeNsec() { // with nanoseconds 55 61 timespec curr; 56 clock_gettime( CLOCK_REALTIME _COARSE, &curr );62 clock_gettime( CLOCK_REALTIME, &curr ); 57 63 return (Time){ curr }; 58 64 } // getTime
Note: See TracChangeset
for help on using the changeset viewer.