Multithreaded-software/utilities/time/time_helper.c
void add_timespec(struct timespec *ts, int64_t addtime)
{
   int64_t sec, nsec;

   nsec = addtime % NSEC_PER_SEC;
   sec = (addtime - nsec) / NSEC_PER_SEC;
   ts->tv_sec += sec;
   ts->tv_nsec += nsec;
   if ( ts->tv_nsec > NSEC_PER_SEC )
   {
      nsec = ts->tv_nsec % NSEC_PER_SEC;
      ts->tv_sec += (ts->tv_nsec - nsec) / NSEC_PER_SEC;
      ts->tv_nsec = nsec;
   }
}
// Needs the definition of int64
// The definition comes from ethercat osal.h
Needs the definition of int64
The definition comes from ethercat osal.h
Needs the definition of int64 The definition comes from ethercat osal . h
void add_timespec(struct timespec *ts, int64_t addtime)
{
   int64_t sec, nsec;
   nsec = addtime % NSEC_PER_SEC;
   sec = (addtime - nsec) / NSEC_PER_SEC;
   ts->tv_sec += sec;
   ts->tv_nsec += nsec;
   if ( ts->tv_nsec > NSEC_PER_SEC )
   {
      nsec = ts->tv_nsec % NSEC_PER_SEC;
      ts->tv_sec += (ts->tv_nsec - nsec) / NSEC_PER_SEC;
      ts->tv_nsec = nsec;
   }
}
void add_timespec ( struct timespec * ts , int64_t addtime ) { int64_t sec , nsec ; nsec = addtime % NSEC_PER_SEC ; sec = ( addtime - nsec ) / NSEC_PER_SEC ; ts -> tv_sec += sec ; ts -> tv_nsec += nsec ; if ( ts -> tv_nsec > NSEC_PER_SEC ) { nsec = ts -> tv_nsec % NSEC_PER_SEC ; ts -> tv_sec += ( ts -> tv_nsec - nsec ) / NSEC_PER_SEC ; ts -> tv_nsec = nsec ; } }
Needs the definition of int64
The definition comes from ethercat osal.h
Needs the definition of int64 The definition comes from ethercat osal . h