📅  最后修改于: 2022-03-11 14:55:13.531000             🧑  作者: Mango
function readingTime() {
const text = document.getElementById("article").innerText;
const wpm = 225;
const words = text.trim().split(/\s+/).length;
const time = Math.ceil(words / wpm);
document.getElementById("time").innerText = time;
}
readingTime();Code language: JavaScript (javascript)