topic description
it takes a few seconds to print out the current time
related codes
/ / Please paste the code text below (do not replace the code with pictures)
have tried the following ways, but the time printed is the time when the code is running
let time = new Date();
console.log(time);
setTimeout(() => {
let data = new Date();
console.log(time);
}, 5000);
what result do you expect? What is the error message actually seen?
I hope to be able to print out the current time in 5 seconds