UNPKG

@snap/camera-kit

Version:
82 lines (46 loc) 2.18 kB
[CameraKit Web SDK - v0.22.0](../README.md) / [Exports](../modules.md) / LensPerformanceMeasurement # Class: LensPerformanceMeasurement Represents an ongoing measurement of rendering metrics. An instance of this class is obtained by calling [LensPerformanceMetrics.beginMeasurement](LensPerformanceMetrics.md#beginmeasurement). Then it may be used to record rendering performance metrics, reset measurement, or end the measurement. ## Table of contents ### Constructors - [constructor](LensPerformanceMeasurement.md#constructor) ### Methods - [measure](LensPerformanceMeasurement.md#measure) - [reset](LensPerformanceMeasurement.md#reset) - [end](LensPerformanceMeasurement.md#end) ## Constructors ### constructor**new LensPerformanceMeasurement**(`instances`): [`LensPerformanceMeasurement`](LensPerformanceMeasurement.md) #### Parameters | Name | Type | | :------ | :------ | | `instances` | `Set`\<[`LensPerformanceMeasurement`](LensPerformanceMeasurement.md)\> | #### Returns [`LensPerformanceMeasurement`](LensPerformanceMeasurement.md) ## Methods ### measure**measure**(): [`ComputedFrameMetrics`](../interfaces/ComputedFrameMetrics.md) Return a [ComputedFrameMetrics](../interfaces/ComputedFrameMetrics.md) object, containing lens performance metrics. This method may be called multiple times, each time reporting values computed since the time when this instance was created. #### Returns [`ComputedFrameMetrics`](../interfaces/ComputedFrameMetrics.md) ___ ### reset**reset**(): `void` Reset the measured performance statistics (averages, std deviations). This is equivalent to using [LensPerformanceMetrics.beginMeasurement](LensPerformanceMetrics.md#beginmeasurement) to create a new LensPerformanceMeasurement instance, but may be more convenient. #### Returns `void` ___ ### end**end**(): `void` Stop measuring performance statistics. This instance will not be garbage collected until this method is called. Therefore it is important to call this method at the appropriate time to avoid leaking memory -- particularly if your application creates many LensPerformanceMeasurement instances. #### Returns `void`