Hackerss.com

hackerss
hackerss

Posted on

Print current time in milliseconds in Javascript

Print current time in milliseconds - Javascript:


//function to print current time in milliseconds
function printTime() {
  // print the current time in milliseconds
  console.log(Date.now());
}

//example
const result = printTime();

//output
console.log(result); //1589788590956


Enter fullscreen mode Exit fullscreen mode

Top comments (0)