How to keep animated gif running while doing intense calculations

后端 未结 7 1528
一向
一向 2020-12-06 05:15

I have a page which does some intense and long lasting calculations in Javascript. I would like to have a loading animation to tell the user progress is being made. I have a

7条回答
  •  孤城傲影
    2020-12-06 05:48

    I answered this with a functioning example (with simple progress indicator) here.

    It uses "yield" and is extremely simple to use (and modify existing JS loops) when you simply want to allow other processes a timeslice, and it is simpler to set up than web workers (which I have used as well), especially if you already have a loop interacting with global variables.

提交回复
热议问题