@@ -80,7 +80,7 @@ struct record_cputime_state_thr {
8080
8181struct record_cputime_state {
8282 bool supported ;
83- dds_time_t tprev ;
83+ ddsrt_hrtime_t tprev ;
8484 uint32_t vcswprev ;
8585 uint32_t ivcswprev ;
8686 size_t nthreads ;
@@ -113,7 +113,7 @@ static bool above_threshold (double *max, double *du_skip, double *ds_skip, doub
113113 }
114114}
115115
116- bool record_cputime (struct record_cputime_state * state , const char * prefix , dds_time_t tnow )
116+ bool record_cputime (struct record_cputime_state * state , const char * prefix , ddsrt_hrtime_t tnow )
117117{
118118 if (state == NULL )
119119 return false;
@@ -126,7 +126,7 @@ bool record_cputime (struct record_cputime_state *state, const char *prefix, dds
126126 }
127127 double max = 0 ;
128128 double du_skip = 0.0 , ds_skip = 0.0 ;
129- const double dt = (double ) (tnow - state -> tprev ) / 1e9 ;
129+ const double dt = (double ) (tnow . v - state -> tprev . v ) / 1e9 ;
130130 bool some_above = false;
131131
132132 state -> s .maxrss = (double ) usage .maxrss ;
@@ -205,7 +205,7 @@ struct record_cputime_state *record_cputime_new (dds_entity_t wr)
205205 ddsrt_rusage_t usage ;
206206 if (ddsrt_getrusage (DDSRT_RUSAGE_SELF , & usage ) < 0 )
207207 usage .nvcsw = usage .nivcsw = 0 ;
208- state -> tprev = dds_time ();
208+ state -> tprev = ddsrt_time_highres ();
209209 state -> wr = wr ;
210210 state -> vcswprev = (uint32_t ) usage .nvcsw ;
211211 state -> ivcswprev = (uint32_t ) usage .nivcsw ;
@@ -259,7 +259,7 @@ void record_cputime_free (struct record_cputime_state *state)
259259
260260#else
261261
262- bool record_cputime (struct record_cputime_state * state , const char * prefix , dds_time_t tnow )
262+ bool record_cputime (struct record_cputime_state * state , const char * prefix , ddsrt_hrtime_t tnow )
263263{
264264 (void ) state ;
265265 (void ) prefix ;
0 commit comments