@snap/camera-kit
Version:
Camera Kit Web
46 lines (26 loc) • 1.14 kB
Markdown
[**CameraKit Web SDK v1.13.0**](../README.md)
***
[CameraKit Web SDK](../globals.md) / LensPerformanceMetrics
# Class: LensPerformanceMetrics
Use to measure lens rendering performance.
The [LensPerformanceMetrics.beginMeasurement](LensPerformanceMetrics.md#beginmeasurement) method is used to start measuring rendering performance. After
a measurement has begun, performance metrics can be read using [LensPerformanceMeasurement](LensPerformanceMeasurement.md).
## Example
```ts
const measurement = cameraKitSession.metrics.beginMeasurement()
// some time later
console.log(measurement.measure())
```
## Methods
### beginMeasurement()
> **beginMeasurement**(): [`LensPerformanceMeasurement`](LensPerformanceMeasurement.md)
Begin a measurement window, during which time rendering metrics will be gathered.
#### Returns
[`LensPerformanceMeasurement`](LensPerformanceMeasurement.md)
A [LensPerformanceMeasurement](LensPerformanceMeasurement.md) representing an ongoing measurement of aggregated rendering
metrics, from which specific metrics can be obtained.
***
### destroy()
> **destroy**(): `void`
#### Returns
`void`