📜  javascript 日期时区 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:34.847000             🧑  作者: Mango

代码示例3
// this example takes 2 seconds to run
const start = Date.now();

console.log('starting timer...');
// expected output: starting timer...

setTimeout(() => {
  const millis = Date.now() - start;

  console.log(`seconds elapsed = ${Math.floor(millis/1000)}`);
  // expected output : seconds elapsed = 2
}, 2000);