# ImageCaptureLatencyEstimate

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/ImageCaptureLatencyEstimate.java+class:androidx.camera.core.ImageCaptureLatencyEstimate) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

*** ** * ** ***


```
public class ImageCaptureLatencyEstimate
```

<br />

*** ** * ** ***

An immutable representation of the estimated duration an image capture will take capturing and processing the current scene according to the scene's lighting condition and/or camera configuration.

The latency estimate is produced by `https://developer.android.com/reference/androidx/camera/core/ImageCapture#getRealtimeCaptureLatencyEstimate()`.

The estimate is comprised of two components: `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#getCaptureLatencyMillis()`, `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#getProcessingLatencyMillis()`.

## Summary

| ### Constants |
|---|---|
| `static final long` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#UNDEFINED_CAPTURE_LATENCY() = -1` The capture latency is unsupported or undefined |
| `static final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#UNDEFINED_IMAGE_CAPTURE_LATENCY()` The image capture latency estimate is unsupported or undefined |
| `static final long` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#UNDEFINED_PROCESSING_LATENCY() = -1` The processing latency is unsupported or undefined |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#ImageCaptureLatencyEstimate(long,long)( long captureLatencyMillis, long processingLatencyMillis )` Created by `https://developer.android.com/reference/androidx/camera/core/ImageCapture#getRealtimeCaptureLatencyEstimate()` when querying for the current realtime latency estimate. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html o)` |
| `long` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#getCaptureLatencyMillis()()` Returns the estimated duration in milliseconds from when the camera begins capturing frames to the moment the camera has completed capturing frames. |
| `long` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#getProcessingLatencyMillis()()` Returns the estimated duration in milliseconds from when the processing begins until the processing has completed and the final processed capture is available. |
| `long` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#getTotalCaptureLatencyMillis()()` Returns the total estimated capture duration in milliseconds. |
| `int` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#toString()()` |

## Constants

### UNDEFINED_CAPTURE_LATENCY

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
public static final long UNDEFINED_CAPTURE_LATENCY = -1
```

The capture latency is unsupported or undefined

### UNDEFINED_IMAGE_CAPTURE_LATENCY

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
public static final @NonNull ImageCaptureLatencyEstimate UNDEFINED_IMAGE_CAPTURE_LATENCY
```

The image capture latency estimate is unsupported or undefined

### UNDEFINED_PROCESSING_LATENCY

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
public static final long UNDEFINED_PROCESSING_LATENCY = -1
```

The processing latency is unsupported or undefined

## Public constructors

### ImageCaptureLatencyEstimate

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
public ImageCaptureLatencyEstimate(
    long captureLatencyMillis,
    long processingLatencyMillis
)
```

Created by `https://developer.android.com/reference/androidx/camera/core/ImageCapture#getRealtimeCaptureLatencyEstimate()` when querying for the current realtime latency estimate. This can also be used for testing. It is not necessary to explicitly construct this in any other scenario.

| Parameters |
|---|---|
| `long captureLatencyMillis` | The estimated duration in milliseconds from when the camera begins capturing frames to the moment the camera has completed capturing frames. |
| `long processingLatencyMillis` | The estimated duration in milliseconds from when the processing begins until the processing has completed and the final processed capture is available. |

## Public methods

### equals

```
public boolean equals(Object o)
```

### getCaptureLatencyMillis

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
public long getCaptureLatencyMillis()
```

Returns the estimated duration in milliseconds from when the camera begins capturing frames to the moment the camera has completed capturing frames. If this estimate is not supported or not available then it will be `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#UNDEFINED_CAPTURE_LATENCY()`.

### getProcessingLatencyMillis

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
public long getProcessingLatencyMillis()
```

Returns the estimated duration in milliseconds from when the processing begins until the processing has completed and the final processed capture is available. If this estimate is not supported or not available then it will be `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#UNDEFINED_PROCESSING_LATENCY()`.

### getTotalCaptureLatencyMillis

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
public long getTotalCaptureLatencyMillis()
```

Returns the total estimated capture duration in milliseconds. This includes time spent in capturing and processing.

If either the capture latency or processing latency is undefined then the total estimate is `https://developer.android.com/reference/androidx/camera/core/ImageCaptureLatencyEstimate#UNDEFINED_CAPTURE_LATENCY()`.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```