var start = Date.now();
var response = prompt("What is your name?", "");
var end = Date.now();
var elapsed = (end - start) / 1000;
document.write("You took " + elapsed + " seconds" + " to type: " + response);
为什么start和end都是Date.now()? 还有elapsed=(end-start)/1000是什么意思啊?
冉冉说
相关分类