Date.now()
ES5+Returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
Syntax
Date.now()Return Value
number
A number representing the milliseconds elapsed since the UNIX epoch
Examples
JavaScript
console.log(Date.now());
// μ±λ₯ μΈ‘μ μ μ μ©
const start = Date.now();
// ... μμ
μν
const end = Date.now();
console.log('μμ μκ°:', end - start, 'ms'); Output:
// 1705123456789
μμ μκ°: 5 ms