setInterval with loop time

后端 未结 4 1938
醉梦人生
醉梦人生 2020-12-05 06:58
setInterval(function(){}, 200)

this code run the function each 200 miliseconds, how do I do it if I only want the function to be ran 10 times.

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 07:20

    Just use a for loop instead, much easier:

    Just try this code.

    for (counter=0; counter<0; counter++) {}
    

提交回复
热议问题