Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Return current universal time expressed as milliseconds since midnight, January 1, 1970. |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
now; // current universal time |
Return value
Returns the current universal time expressed in milliseconds since 00:00:00 on January 1, 1970 UTC.
This is directly equivalent to doing: (new Date()).getTime();
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
function foo() { var start = now; // do some stuff var end = now; console("time taken to do stuff = "+(end-start)+"ms"); } foo(); // outputs console msg showing time taken |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
This feature requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
GlobalsTopics:
|