ErtsSystemTime erts_os_system_time(void) { Sint64 stime = posix_clock_gettime(WALL_CLOCK_ID, WALL_CLOCK_ID_STR); return adj_stime_time_unit((ErtsSystemTime) stime, (Uint32) 1000*1000*1000); }
timestamp_t get_timestamp(void) { struct timespec ts; if (posix_clock_gettime(CLOCK_REALTIME, &ts)) exit(1); return ((timestamp_t) ts.tv_sec) * 1000000000LLU +((timestamp_t) ts.tv_nsec); }
static ErtsMonotonicTime clock_gettime_monotonic_verified(void) { ErtsMonotonicTime mtime; mtime = (ErtsMonotonicTime) posix_clock_gettime(MONOTONIC_CLOCK_ID, MONOTONIC_CLOCK_ID_STR); erts_smp_mtx_lock(&internal_state.w.f.mtx); if (mtime < internal_state.w.f.last_delivered) mtime = internal_state.w.f.last_delivered; else internal_state.w.f.last_delivered = mtime; erts_smp_mtx_unlock(&internal_state.w.f.mtx); return mtime; }
ErtsSysHrTime erts_sys_hrtime(void) { return (ErtsSysHrTime) posix_clock_gettime(HRTIME_CLOCK_ID, HRTIME_CLOCK_ID_STR); }
ErtsMonotonicTime erts_os_monotonic_time(void) { return posix_clock_gettime(MONOTONIC_CLOCK_ID, MONOTONIC_CLOCK_ID_STR); }
static ErtsMonotonicTime clock_gettime_monotonic_raw(void) { return (ErtsMonotonicTime) posix_clock_gettime(CLOCK_MONOTONIC_RAW, "CLOCK_MONOTONIC_RAW"); }
static ErtsMonotonicTime clock_gettime_monotonic(void) { return (ErtsMonotonicTime) posix_clock_gettime(MONOTONIC_CLOCK_ID, MONOTONIC_CLOCK_ID_STR); }