Beispiel #1
0
void
gtimer_arm_abs
  (gtimer_t *gti, gti_callback_t *callback, void *opaque, time_t when)
{
  struct timespec ts;
  ts.tv_nsec = 0;
  ts.tv_sec  = when;
  gtimer_arm_abs2(gti, callback, opaque, &ts);
}
Beispiel #2
0
void
gtimer_arm_ms
  (gtimer_t *gti, gti_callback_t *callback, void *opaque, long delta_ms )
{
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  ts.tv_nsec += (1000000 * delta_ms);
  ts.tv_sec  += (ts.tv_nsec / 1000000000);
  ts.tv_nsec %= 1000000000;
  gtimer_arm_abs2(gti, callback, opaque, &ts);
}
Beispiel #3
0
void
GTIMER_FCN(gtimer_arm_abs)
  (GTIMER_TRACEID_ gtimer_t *gti, gti_callback_t *callback, void *opaque, time_t when)
{
  struct timespec ts;
  ts.tv_nsec = 0;
  ts.tv_sec  = when;
#if ENABLE_GTIMER_CHECK
  GTIMER_FCN(gtimer_arm_abs2)(id, fcn, gti, callback, opaque, &ts);
#else
  gtimer_arm_abs2(gti, callback, opaque, &ts);
#endif
}
Beispiel #4
0
void
GTIMER_FCN(gtimer_arm_ms)
  (GTIMER_TRACEID_ gtimer_t *gti, gti_callback_t *callback, void *opaque, long delta_ms )
{
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  ts.tv_nsec += (1000000 * delta_ms);
  ts.tv_sec  += (ts.tv_nsec / 1000000000);
  ts.tv_nsec %= 1000000000;
#if ENABLE_GTIMER_CHECK
  GTIMER_FCN(gtimer_arm_abs2)(id, fcn, gti, callback, opaque, &ts);
#else
  gtimer_arm_abs2(gti, callback, opaque, &ts);
#endif
}