Example #1
0
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);
}
Example #2
0
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);
}
Example #3
0
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;
}
Example #4
0
ErtsSysHrTime
erts_sys_hrtime(void)
{
    return (ErtsSysHrTime) posix_clock_gettime(HRTIME_CLOCK_ID,
					       HRTIME_CLOCK_ID_STR);
}
Example #5
0
ErtsMonotonicTime erts_os_monotonic_time(void)
{
    return posix_clock_gettime(MONOTONIC_CLOCK_ID,
			       MONOTONIC_CLOCK_ID_STR);
}
Example #6
0
static ErtsMonotonicTime clock_gettime_monotonic_raw(void)
{
    return (ErtsMonotonicTime) posix_clock_gettime(CLOCK_MONOTONIC_RAW,
						   "CLOCK_MONOTONIC_RAW");
}
Example #7
0
static ErtsMonotonicTime clock_gettime_monotonic(void)
{
    return (ErtsMonotonicTime) posix_clock_gettime(MONOTONIC_CLOCK_ID,
						   MONOTONIC_CLOCK_ID_STR);
}