Sha256: c9736e1212c06d473e7fe69f5a247621d247e6dfacf6e4b9d336e71880e89627

Contents?: true

Size: 462 Bytes

Versions: 7

Compression:

Stored size: 462 Bytes

Contents

#ifdef USE_INSTANT_CLOCK_GETTIME

#include "hitimes_interval.h"

#include <sys/time.h>

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

7 entries across 7 versions & 2 rubygems

Version Path
hitimes-0.2.0 ext/hitimes_instant_clock_gettime.c
hitimes-0.2.1 ext/hitimes_instant_clock_gettime.c
hitimes-0.3.0 ext/hitimes_instant_clock_gettime.c
hitimes-0.3.0-x86-mswin32-60 ext/hitimes_instant_clock_gettime.c
hitimes-0.4.0 ext/hitimes_instant_clock_gettime.c
hitimes-0.4.0-x86-mswin32-60 ext/hitimes_instant_clock_gettime.c
stella-0.5.4 vendor/hitimes-0.4.0/ext/hitimes_instant_clock_gettime.c