Is there anyway to check how long microtasks take to execute?

233 Views Asked by At

I would like to time a function which will spawn a bunch of microtasks. I would like to time how long the microtasks took to execute and exclude the idle time that the event loop was empty. It's impractical to find every line of code that queues a microtask so I need a general way of measuring the blocking time spent by microtasks while the function was running.

How can I do that?

I would be interested in how to do this in any engine but most interested in react native with JavaScript core. Perhaps possible with Xcode instruments?

1

There are 1 best solutions below

3
Evgeniy On

Try to use Flipper .There you can test the performance, how much components are rendered in time and functions are performed.