Noah Grant
Aug 8, 2017 · 1 min read

So, I’m starting to play around with this, and one thing I’m finding that you might also be interested in is that rafs in event handlers are always executed in the _same frame_. So that’s a little tough to use as a measurement because it will fire after the JS thread but won’t include any layouts or paints. An alternative is to schedule a raf inside your event handling raf, which _does_ get called in the next frame—but, since it gets called after the other frame JS, the time measurement will be (JS + layout + paint from frame1) + (JS + frame2), which also isn’t an accurate measurement. I’m not totally sure how to get around this for now, other than to increase the jank limit to account for the extra JS stack.