- Products -


Software


NEWS


Special



- Knowledge -


Category × Tag



- Like -

公開
作成日:2021/11/7
更新日:2021/11/7

【Javascript】経過秒数を取得する方法

・以下の方法で取得可能。


var start_time = Date.now();

function show_diffs(){
  var diff = start_time - Date.now();
  console.log(Math.floor( Math.abs(diff)/1000 ) + '秒経過');
}


参考


https://gray-code.com/javascript/calculate-the-difference-between-two-dates-and-times/#section3


Category



Tag




関連記事


{{tmp.name}}

{{article.category}} {{article.title}}