public abstract class FrameStats
extends Object



This is the base class for frame statistics.

Summary

Constants

long UNDEFINED_TIME_NANO

Undefined time.

Public constructors

FrameStats()

Public methods

final long getEndTimeNano()

Gets the end time of the interval for which these statistics apply.

final int getFrameCount()

Gets the number of frames for which there is data.

final long getFramePresentedTimeNano(int index)

Get the time a frame at a given index was presented.

final long getRefreshPeriodNano()

Gets the refresh period of the display hosting the window(s) for which these statistics apply.

final long getStartTimeNano()

Gets the start time of the interval for which these statistics apply.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Constants

UNDEFINED_TIME_NANO

public static final long UNDEFINED_TIME_NANO

Undefined time.

Constant Value: -1 (0xffffffffffffffff)

Public constructors

FrameStats

public FrameStats ()

Public methods

getEndTimeNano

public final long getEndTimeNano ()

Gets the end time of the interval for which these statistics apply. The end interval is the time when the last frame was presented.

Returns
long The end time in nanoseconds or UNDEFINED_TIME_NANO if there is no frame data.

getFrameCount

public final int getFrameCount ()

Gets the number of frames for which there is data.

Returns
int The number of frames.

getFramePresentedTimeNano

public final long getFramePresentedTimeNano (int index)

Get the time a frame at a given index was presented.

Parameters
index int: The frame index.
Returns
long The presented time in nanoseconds or UNDEFINED_TIME_NANO if the frame is not presented yet.

getRefreshPeriodNano

public final long getRefreshPeriodNano ()

Gets the refresh period of the display hosting the window(s) for which these statistics apply.

Returns
long The refresh period in nanoseconds.

getStartTimeNano

public final long getStartTimeNano ()

Gets the start time of the interval for which these statistics apply. The start interval is the time when the first frame was presented.

Returns
long The start time in nanoseconds or UNDEFINED_TIME_NANO if there is no frame data.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-02-10 UTC.