【发布时间】:2020-05-06 07:56:57
【问题描述】:
我想让这段代码工作:
let wait = 1;
function speedup(){
wait = 0.5
}
// I want it so that if the speed-up button is pressed the code repeats but faster
<html>
<body>
<a onclick="speedup()">speed up</a>
<p id="p">0</p>
</body>
</html>
有人可以帮忙吗?我需要将它用于用户可以按下按钮以加快 igc 漫长过程的游戏。
【问题讨论】:
-
"按钮被按下,代码重复但更快" 你指的是哪个代码,现在它是如何重复的?
标签: javascript loops timing