Sha256: 6c222065caabff6e3b2f9e4f9a2098a89df96ee2d7dfecb0e57341fc12d9345b
Contents?: true
Size: 508 Bytes
Versions: 9
Compression:
Stored size: 508 Bytes
Contents
#include <errno.h> #include <time.h> #include "ruby_helpers.h" #include "time_helpers.h" // Safety: This function is assumed never to raise exceptions by callers when raise_on_failure == false long monotonic_wall_time_now_ns(bool raise_on_failure) { struct timespec current_monotonic; if (clock_gettime(CLOCK_MONOTONIC, ¤t_monotonic) != 0) { if (raise_on_failure) ENFORCE_SUCCESS_GVL(errno); return 0; } return current_monotonic.tv_nsec + SECONDS_AS_NS(current_monotonic.tv_sec); }
Version data entries
9 entries across 9 versions & 1 rubygems