Changeset 8ad6533 for src/libcfa/time


Ignore:
Timestamp:
Apr 9, 2018, 2:21:27 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
0f56058, ca37445
Parents:
35f730f
Message:

remove cfatime.h, move itimerval constructor to "time", update concurrent examples to use Duration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/time

    r35f730f r8ad6533  
    1010// Created On       : Wed Mar 14 23:18:57 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr  6 11:15:49 2018
    13 // Update Count     : 610
     12// Last Modified On : Mon Apr  9 13:10:23 2018
     13// Update Count     : 616
    1414//
    1515
     
    128128
    129129
     130//######################### C itimerval #########################
     131
     132static inline void ?{}( itimerval & itv, Duration alarm ) with( itv ) {
     133        // itimerval contains durations but but uses time data-structure timeval.
     134        it_value{ alarm`s, (alarm % 1`s)`us };                          // seconds, microseconds
     135        it_interval{ 0 };                                                                       // 0 seconds, 0 microseconds
     136} // itimerval
     137
     138static inline void ?{}( itimerval & itv, Duration alarm, Duration interval ) with( itv ) {
     139        // itimerval contains durations but but uses time data-structure timeval.
     140        it_value{ alarm`s, (alarm % 1`s)`us };                          // seconds, microseconds
     141        it_interval{ interval`s, interval`us };                         // seconds, microseconds
     142} // itimerval
     143
     144
    130145//######################### C time #########################
    131146
     
    142157struct Time {                                                                                   // private
    143158        uint64_t tv;                                                                            // nanoseconds since UNIX epoch
    144 };
     159}; // Time
    145160
    146161static inline void ?{}( Time & t ) with( t ) { tv = 0; } // fast
Note: See TracChangeset for help on using the changeset viewer.