Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vistahigherlearning / logstash   deb

Repository URL to install this package:

/ opt / logstash / vendor / bundle / jruby / 1.9 / gems / hitimes-1.2.1-java / ext / hitimes / c / hitimes_instant_clock_gettime.c

#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