* Yields the thread before running the function to avoid causing jank. (i.e. a * task that takes over 16ms.) * @param {function(): OUT} fn * @return {!Promise } * @template OUT
(fn)
| 53 | * @template OUT |
| 54 | */ |
| 55 | function yieldThread(fn) { |
| 56 | return new Promise((resolve) => { |
| 57 | setTimeout(() => resolve(fn())); |
| 58 | }); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Checks whether the given object is a valid resource timing spec. |
no test coverage detected