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

Related Methods