FileDocCategorySizeDatePackage
FrameStats.javaAPI DocAndroid 5.1 API3009Thu Mar 12 22:22:10 GMT 2015android.view

FrameStats

public abstract class FrameStats extends Object
This is the base class for frame statistics.

Fields Summary
public static final long
UNDEFINED_TIME_NANO
Undefined time.
protected long
mRefreshPeriodNano
protected long[]
mFramesPresentedTimeNano
Constructors Summary
Methods Summary
public final longgetEndTimeNano()
Gets the end time of the interval for which these statistics apply. The end interval is the time when the last frame was presented.

return
The end time in nanoseconds or {@link #UNDEFINED_TIME_NANO} if there is no frame data.

        if (getFrameCount() <= 0) {
            return UNDEFINED_TIME_NANO;
        }
        return mFramesPresentedTimeNano[mFramesPresentedTimeNano.length - 1];
    
public final intgetFrameCount()
Gets the number of frames for which there is data.

return
The number of frames.

        return mFramesPresentedTimeNano != null
                ? mFramesPresentedTimeNano.length : 0;
    
public final longgetFramePresentedTimeNano(int index)
Get the time a frame at a given index was presented.

param
index The frame index.
return
The presented time in nanoseconds or {@link #UNDEFINED_TIME_NANO} if the frame is not presented yet.

        if (mFramesPresentedTimeNano == null) {
            throw new IndexOutOfBoundsException();
        }
        return mFramesPresentedTimeNano[index];
    
public final longgetRefreshPeriodNano()
Gets the refresh period of the display hosting the window(s) for which these statistics apply.

return
The refresh period in nanoseconds.


                              
        
        return mRefreshPeriodNano;
    
public final longgetStartTimeNano()
Gets the start time of the interval for which these statistics apply. The start interval is the time when the first frame was presented.

return
The start time in nanoseconds or {@link #UNDEFINED_TIME_NANO} if there is no frame data.

        if (getFrameCount() <= 0) {
            return UNDEFINED_TIME_NANO;
        }
        return mFramesPresentedTimeNano[0];