When using this code, the message is updated every second, and then suddenly moves slowly or quickly in every five seconds. I want to make a more stable timer. What should I do?
const { Client, GatewayIntentBits, Collection } = require('discord.js');
module.exports = {
name: "timer",
async execute(message, args) {
ggg=args.shift(1)
let timecc = ggg*60
const tic = await message.reply("⏳"+parseInt((timecc / 60)/60)+"h"+parseInt((timecc / 60)%60)+"m"+(timecc % 60)+"s")
var timer = setInterval(() => {
timecc --
tic.edit({ content: "⏳"+parseInt((timecc / 60)/60)+"h"+parseInt((timecc / 60)%60)+"m"+(timecc % 60)+"s" })
.catch(console.warn = () => {});
if (timecc === 0) {
clearInterval(timer);
tic.edit({ content: "⌛"+"@everyone time out!" })
.catch(console.warn = () => {});
}
}, 1000)
}
}