/** * Returns the current timestamp with microsecond precision via a system call to {@code * gettimeofday}, through JNR C library. * * @return the current timestamp with microsecond precision. * @throws UnsupportedOperationException if JNR C library is not loaded or {@code gettimeofday} is * not available. * @throws IllegalStateException if the call to {@code gettimeofday} did not complete with return * code 0. */ public static long currentTimeMicros() { if (!isGettimeofdayAvailable()) throw new UnsupportedOperationException( "JNR C library not loaded or gettimeofday not available"); LibCLoader.Timeval tv = new LibCLoader.Timeval(LibCLoader.LIB_C_RUNTIME); int res = LibCLoader.LIB_C.gettimeofday(tv, null); if (res != 0) throw new IllegalStateException("Call to gettimeofday failed with result " + res); return tv.tv_sec.get() * 1000000 + tv.tv_usec.get(); }
/** * Returns the current timestamp with microsecond precision * via a system call to {@code gettimeofday}, through JNR C library. * * @return the current timestamp with microsecond precision. * @throws UnsupportedOperationException if JNR C library is not loaded or {@code gettimeofday} is not available. * @throws IllegalStateException if the call to {@code gettimeofday} did not complete with return code 0. */ public static long currentTimeMicros() { if (!isGettimeofdayAvailable()) throw new UnsupportedOperationException("JNR C library not loaded or gettimeofday not available"); LibCLoader.Timeval tv = new LibCLoader.Timeval(LibCLoader.LIB_C_RUNTIME); int res = LibCLoader.LIB_C.gettimeofday(tv, null); if (res != 0) throw new IllegalStateException("Call to gettimeofday failed with result " + res); return tv.tv_sec.get() * 1000000 + tv.tv_usec.get(); }
/** * The current time in microseconds, as returned by libc.gettimeofday(); can only be used if * {@link #isCurrentTimeMicrosAvailable()} is true. */ public static long currentTimeMicros() { if (!isCurrentTimeMicrosAvailable()) { throw new IllegalStateException( "Native call not available. " + "Check isCurrentTimeMicrosAvailable() before calling this method."); } LibCLoader.Timeval tv = new LibCLoader.Timeval(LibCLoader.LIB_C_RUNTIME); int res = LibCLoader.LIB_C.gettimeofday(tv, null); if (res != 0) { throw new IllegalStateException("Call to libc.gettimeofday() failed with result " + res); } return tv.tv_sec.get() * 1000000 + tv.tv_usec.get(); }
/** * Returns the current timestamp with microsecond precision * via a system call to {@code gettimeofday}, through JNR C library. * * @return the current timestamp with microsecond precision. * @throws UnsupportedOperationException if JNR C library is not loaded or {@code gettimeofday} is not available. * @throws IllegalStateException if the call to {@code gettimeofday} did not complete with return code 0. */ public static long currentTimeMicros() { if (!isGettimeofdayAvailable()) throw new UnsupportedOperationException("JNR C library not loaded or gettimeofday not available"); LibCLoader.Timeval tv = new LibCLoader.Timeval(LibCLoader.LIB_C_RUNTIME); int res = LibCLoader.LIB_C.gettimeofday(tv, null); if (res != 0) throw new IllegalStateException("Call to gettimeofday failed with result " + res); return tv.tv_sec.get() * 1000000 + tv.tv_usec.get(); }
/** * Returns the current timestamp with microsecond precision * via a system call to {@code gettimeofday}, through JNR C library. * * @return the current timestamp with microsecond precision. * @throws UnsupportedOperationException if JNR C library is not loaded or {@code gettimeofday} is not available. * @throws IllegalStateException if the call to {@code gettimeofday} did not complete with return code 0. */ public static long currentTimeMicros() { if (!isGettimeofdayAvailable()) throw new UnsupportedOperationException("JNR C library not loaded or gettimeofday not available"); LibCLoader.Timeval tv = new LibCLoader.Timeval(LibCLoader.LIB_C_RUNTIME); int res = LibCLoader.LIB_C.gettimeofday(tv, null); if (res != 0) throw new IllegalStateException("Call to gettimeofday failed with result " + res); return tv.tv_sec.get() * 1000000 + tv.tv_usec.get(); }
public long getLength() { return length.get(); }
public long getLength() { return length.get(); }
public long getLength() { return length.get(); }
public long getLength() { return length.get(); }
/** * Returns a java int representation of this field. * * @return a java int value for this field. */ @Override public final int intValue() { return (int) get(); }
/** * Returns a java long representation of this field. * * @return a java long value for this field. */ @Override public final long longValue() { return get(); } }
/** * Returns a java int representation of this field. * * @return a java int value for this field. */ @Override public final int intValue() { return (int) get(); }
/** * Returns a java int representation of this field. * * @return a java int value for this field. */ @Override public final int intValue() { return (int) get(); }
/** * Returns a java long representation of this field. * * @return a java long value for this field. */ @Override public final long longValue() { return get(); } }
/** * Returns a java long representation of this field. * * @return a java long value for this field. */ @Override public final long longValue() { return get(); } }