elapsed Real Time Nanos - Android Android OS

Android examples for Android OS:System Clock

Description

elapsed Real Time Nanos

Demo Code


//package com.java2s;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.SystemClock;

public class Main {
    @TargetApi(17)/*w  ww.j  av a 2 s .c  o  m*/
    public static long elapsedRealTimeNanos() {
        if (Build.VERSION.SDK_INT >= 17) {
            return SystemClock.elapsedRealtimeNanos();
        }
        return SystemClock.elapsedRealtime() * 1000000l;
    }
}

Related Tutorials