Skip to content

Commit 304ef7f

Browse files
Elchi3Josh-Cenajpmedley
authored
Document PerformanceMark/PerformanceMeasure.detail (#21823)
* Document PerformanceMark/PerformanceMeasure.detail * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Joe Medley <[email protected]> Co-authored-by: Joshua Chen <[email protected]> Co-authored-by: Joe Medley <[email protected]>
1 parent 180381f commit 304ef7f

File tree

4 files changed

+89
-7
lines changed

4 files changed

+89
-7
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: PerformanceMark.detail
3+
slug: Web/API/PerformanceMark/detail
4+
page-type: web-api-instance-property
5+
tags:
6+
- API
7+
- Property
8+
- Reference
9+
- Web Performance
10+
browser-compat: api.PerformanceMark.detail
11+
---
12+
13+
{{APIRef}}
14+
15+
The read-only **`detail`** property returns arbitrary metadata that was included in the mark upon construction (either when using {{domxref("Performance.mark","performance.mark()")}} or the {{domxref("PerformanceMark.PerformanceMark","PerformanceMark()")}} constructor).
16+
17+
## Value
18+
19+
Returns the value it is set to (from `markOptions` of {{domxref("Performance.mark","performance.mark()")}} or the {{domxref("PerformanceMark.PerformanceMark","PerformanceMark()")}} constructor).
20+
21+
## Examples
22+
23+
The following example demonstrates the `detail` property.
24+
25+
```js
26+
performance.mark("dog", { detail: "labrador" });
27+
28+
const dogEntries = performance.getEntriesByName("dog");
29+
30+
dogEntries[0].detail; // labrador
31+
```
32+
33+
## Specifications
34+
35+
{{Specifications}}
36+
37+
## Browser compatibility
38+
39+
{{Compat}}

files/en-us/web/api/performancemark/index.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,22 @@ Entries of this type are typically created by calling {{domxref("Performance.mar
2828

2929
## Instance properties
3030

31-
This interface has no properties but it extends the following {{domxref("PerformanceEntry")}} properties by qualifying/constraining the properties as follows:
31+
This interface extends the following {{domxref("PerformanceEntry")}} properties by qualifying/constraining the properties as follows:
3232

33-
- {{domxref("PerformanceEntry.entryType")}}
33+
- {{domxref("PerformanceEntry.entryType")}} {{ReadOnlyInline}}
3434
- : Returns "`mark`".
35-
- {{domxref("PerformanceEntry.name")}}
35+
- {{domxref("PerformanceEntry.name")}} {{ReadOnlyInline}}
3636
- : Returns the name given to the mark when it was created via a call to {{domxref("Performance.mark()","performance.mark()")}}.
37-
- {{domxref("PerformanceEntry.startTime")}}
37+
- {{domxref("PerformanceEntry.startTime")}} {{ReadOnlyInline}}
3838
- : Returns the {{domxref("DOMHighResTimeStamp")}} when {{domxref("Performance.mark()","performance.mark()")}} was called.
39-
- {{domxref("PerformanceEntry.duration")}}
39+
- {{domxref("PerformanceEntry.duration")}} {{ReadOnlyInline}}
4040
- : Returns "`0`". (A mark has no _duration_.)
4141

42+
This interface also supports the following properties:
43+
44+
- {{domxref("PerformanceMark.detail")}} {{ReadOnlyInline}}
45+
- : Returns arbitrary metadata that has been included in the mark upon construction.
46+
4247
## Instance methods
4348

4449
This interface has no methods.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: PerformanceMeasure.detail
3+
slug: Web/API/PerformanceMeasure/detail
4+
page-type: web-api-instance-property
5+
tags:
6+
- API
7+
- Property
8+
- Reference
9+
- Web Performance
10+
browser-compat: api.PerformanceMeasure.detail
11+
---
12+
13+
{{APIRef}}
14+
15+
The read-only **`detail`** property returns arbitrary metadata that was included in the mark upon construction (when using {{domxref("Performance.measure","performance.measure()")}}.
16+
17+
## Value
18+
19+
Returns the value it was set to (from `markOptions` of {{domxref("Performance.measure","performance.measure()")}}).
20+
21+
## Examples
22+
23+
The following example demostrates the `detail` property.
24+
25+
```js
26+
performance.measure("dog", { detail: "labrador", start: 0, end: 12345 });
27+
28+
const dogEntries = performance.getEntriesByName("dog");
29+
30+
dogEntries[0].detail; // labrador
31+
```
32+
33+
## Specifications
34+
35+
{{Specifications}}
36+
37+
## Browser compatibility
38+
39+
{{Compat}}

files/en-us/web/api/performancemeasure/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ browser-compat: api.PerformanceMeasure
2323

2424
This interface defines:
2525

26-
- `PerformanceMeasure.detail`
26+
- {{domxref("PerformanceMeasure.detail")}}
2727
- : Contains arbitrary metadata about the measure.
28-
This may be passed in as a property of the {{domxref("Performance.measure()","performance.measure()")}} argument `MeasureOptions`.
2928

3029
In addition, it extends the following {{domxref("PerformanceEntry")}} properties by qualifying/constraining the properties as follows:
3130

0 commit comments

Comments
 (0)