Skip to content

Commit 1d31b7c

Browse files
author
Jake Champion
committed
docs: add performance api docs
1 parent 71bb4d8 commit 1d31b7c

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# performance.now()
9+
10+
The **`performance.now()`** method returns a high resolution timestamp in milliseconds.
11+
It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated).
12+
13+
## Syntax
14+
15+
```js
16+
now()
17+
```
18+
19+
### Parameters
20+
21+
None.
22+
23+
### Return value
24+
25+
Returns a number which represents the time since worker instantation measured in milliseconds.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# performance.timeOrigin
9+
10+
The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps.
11+
12+
This value represents the time when the worker was instantiated.
13+
14+
### Value
15+
16+
Returns a number which represents the time when the worker was instantation.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# performance.now()
9+
10+
The **`performance.now()`** method returns a high resolution timestamp in milliseconds.
11+
It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated).
12+
13+
## Syntax
14+
15+
```js
16+
now()
17+
```
18+
19+
### Parameters
20+
21+
None.
22+
23+
### Return value
24+
25+
Returns a number which represents the time since worker instantation measured in milliseconds.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
hide_title: false
3+
hide_table_of_contents: false
4+
pagination_next: null
5+
pagination_prev: null
6+
---
7+
8+
# performance.timeOrigin
9+
10+
The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps.
11+
12+
This value represents the time when the worker was instantiated.
13+
14+
### Value
15+
16+
Returns a number which represents the time when the worker was instantation.

0 commit comments

Comments
 (0)