The goal is to determine if the overhead of multiple setTimeout
is heavier than a single setInterval
.
Each test has 60 iterations of a function wait
that takes 30ms to run, making the program time 60*30=1800ms, so running these files should capture the overhead by subtracting 1800ms
from the total run time.
It took around 1816ms
or around ~16ms
of overhead.
It took around 3779ms
or aorund ~1979ms
of overhead.
It took around 3769ms
or around ~1969ms
of overhead.