|
do { |
|
res = gen.next() |
|
} while(!res.done && performance.now() - start < 25); |
As the code shows, ts function just runs the user's function gen.next(), but don't compute its time cost. So if gen.next() spends too much time, it still blocks the browser, right?
time-slicing/index.js
Lines 8 to 10 in f75cf7a
As the code shows, ts function just runs the user's function
gen.next(), but don't compute its time cost. So ifgen.next()spends too much time, it still blocks the browser, right?