measure

fun measure(ready: () -> Boolean = { true }, beforeSample: (Int) -> Unit = {}, afterSample: (Int) -> Unit = {}, cleanup: () -> Unit = {}, operation: (Int) -> Unit): Promise<BrowserPerformanceSample>(source)

Waits for application readiness, then measures actions through the following animation frame. Failure or timeout rejects the promise and cannot produce a successful interval. Arbitrary application callback failures must cross the asynchronous boundary with their original cause.