All examples By author By category About

chabb

PI Calculation with webworkers, and "pseudo-profiling"

I just wanted to see how webworkers worked and if they weren't really blocking the main loop.

I took an implementation for calculating the nth decimal of PI, and run some animations on the main loop. I keep the time of each iteration and build a graph with it. You can notice some jitter on the start, it should be the spawning of the thread. You can notice that complexity of the implementation by looking at the graph