5#if defined(HAVE_SYS_TIME_H)
35#define RB_HRTIME_PER_USEC ((rb_hrtime_t)1000)
36#define RB_HRTIME_PER_MSEC (RB_HRTIME_PER_USEC * (rb_hrtime_t)1000)
37#define RB_HRTIME_PER_SEC (RB_HRTIME_PER_MSEC * (rb_hrtime_t)1000)
38#define RB_HRTIME_MAX UINT64_MAX
44#ifdef MY_RUBY_BUILD_MAY_TIME_TRAVEL
63#ifdef HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
64 if (__builtin_mul_overflow(a, b, &c))
83#ifdef HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW
84 if (__builtin_add_overflow(a, b, &c))
98rb_timeval2hrtime(
const struct timeval *tv)
103 return rb_hrtime_add(s, u);
110rb_timespec2hrtime(
const struct timespec *ts)
121rb_msec2hrtime(
unsigned long msec)
133 if (sec <= 0)
return 0;
#define RB_HRTIME_PER_USEC
rb_hrtime_t rb_hrtime_now(void)
#define RB_HRTIME_PER_MSEC
#define RB_HRTIME_PER_SEC