Sha256: 085acfb078156bbf18df5724bc0c17c4b5b8688f891298ba6c0ccb44c5bf3bd5

Contents?: true

Size: 610 Bytes

Versions: 50

Compression:

Stored size: 610 Bytes

Contents

#ifdef USE_INSTANT_CLOCK_GETTIME

#include "hitimes_interval.h"

#include <time.h>
#ifndef CLOCK_MONOTONIC
#  include <sys/time.h>
#  ifndef CLOCK_MONOTONIC
#    ifdef __linux__
#      include <linux/time.h>
#    endif
#  endif
#endif

hitimes_instant_t hitimes_get_current_instant( )
{
    struct timespec time;
    int rc;

    rc = clock_gettime( CLOCK_MONOTONIC, &time);
    if ( 0 != rc )  {
        char* e = strerror( rc );
        rb_raise(eH_Error, "Unable to retrieve time for CLOCK_MONOTONIC :  %s", e );
    }

    return ( ( NANOSECONDS_PER_SECOND * (long)time.tv_sec ) + time.tv_nsec );
}
#endif

Version data entries

50 entries across 50 versions & 3 rubygems

Version Path
hitimes-1.3.1-x64-mingw32 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.3.1-x86-mingw32 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.3.1-java ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.3.1 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.3.0-x64-mingw32 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.3.0-x86-mingw32 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.3.0-java ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.3.0 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.6-x86-mingw32 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.6-java ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.6 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.5-java ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.5-x86-mingw32 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.5 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.4-java ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.4-x86-mingw32 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.4 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.3-x86-mingw32 ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.3-java ext/hitimes/c/hitimes_instant_clock_gettime.c
hitimes-1.2.3 ext/hitimes/c/hitimes_instant_clock_gettime.c