Sha256: 9c3a39bf7b4b5f4e782ffa28c59c8ba2392d063ea70ba5092e733958b3034d44

Contents?: true

Size: 894 Bytes

Versions: 8

Compression:

Stored size: 894 Bytes

Contents

#include <ruby.h>
#include "hitimes_interval.h"

/* Module and Classes */
VALUE mH;           /* module Hitimes            */
VALUE eH_Error;     /* class  Hitimes::Error     */


/**
 * call-seq:
 *    Hitimes.raw_instant -> Integer
 *
 * Return the raw instant value from the operating system
 */
VALUE hitimes_instant_raw( )
{
    unsigned long long i = (unsigned long long)hitimes_get_current_instant( );

    return ULL2NUM(i);
}

/*
 * Document-class: Hitimes::Error
 *
 * General error class for the Hitimes module
 */
void Init_hitimes( )
{
    mH = rb_define_module("Hitimes");

    eH_Error = rb_define_class_under(mH, "Error", rb_eStandardError);
    rb_define_const( mH, "INSTANT_CONVERSION_FACTOR", DBL2NUM( HITIMES_INSTANT_CONVERSION_FACTOR ));
    rb_define_module_function( mH, "raw_instant", hitimes_instant_raw, 0 );

    Init_hitimes_interval();
    Init_hitimes_stats( );
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hitimes-1.3.1-x64-mingw32 ext/hitimes/c/hitimes.c
hitimes-1.3.1-x86-mingw32 ext/hitimes/c/hitimes.c
hitimes-1.3.1-java ext/hitimes/c/hitimes.c
hitimes-1.3.1 ext/hitimes/c/hitimes.c
hitimes-1.3.0-x64-mingw32 ext/hitimes/c/hitimes.c
hitimes-1.3.0-x86-mingw32 ext/hitimes/c/hitimes.c
hitimes-1.3.0-java ext/hitimes/c/hitimes.c
hitimes-1.3.0 ext/hitimes/c/hitimes.c