每次在我的 html 和 js 文件中单击“开始”按钮时,计时器都会增加速度
这是我的菜鸟级代码我不知道发生了什么我刚开始 js :|
kya bakchodi h bhenchod zaruri h kya poori ram kahani likhni yahan chutiya 网站 bhenchod sab 编码专业 h 代码 dekh ke samjh jaate h yahan。 duniya bhar ka rundi rona karwate h bhenchod ye log seedha seedha submit karo na question bhenchod yahan to 1 ghanta ho gaya es code ko change karte karte aur enko 更多细节 chahiye warna 问题提交 nahi karege bc bada hoke hacker banke es site me aag laga duga
var hr = 0;
var min = 0;
var sec = 0;
var milisec = 0;
var timer = false;
function start() {
timer = true;
stopwatch();
}
function stop() {
timer = false;
}
function reset() {
timer = false;
hr = 0;
min = 0;
sec = 0;
milisec = 0;
document.getElementById("hr").innerHTML = "00";
document.getElementById("min").innerHTML = "00";
document.getElementById("sec").innerHTML = "00";
document.getElementById("milisec").innerHTML = "00";
}
function stopwatch() {
if (min == 60) {
hr = hr + 1;
if (hr < 10) {
let hrstring = hr;
hrstring = "0" + hrstring;
document.getElementById("hr").innerHTML = hrstring;
}
else {
document.getElementById("hr").innerHTML = hr;
}
min = 0;
milisec = 0;
sec = 0;
}
if (sec == 60) {
min = min + 1;
if (min < 10) {
let minstring = min;
minstring = "0" + minstring
document.getElementById("min").innerHTML = minstring;
}
else {
document.getElementById("min").innerHTML = min;
}
milisec = 0;
sec = 0;
}
if (milisec == 100) {
sec = sec + 1;
if (sec < 10) {
let secstring = sec;
secstring = "0" + secstring;
document.getElementById("sec").innerHTML = secstring;
}
else {
document.getElementById("sec").innerHTML = sec;
}
milisec = 0;
}
if (timer == true) {
milisec = milisec + 1;
document.getElementById("milisec").innerHTML = milisec;
setTimeout("stopwatch()", 10);
}
}
请帮帮我