diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/ko/web/api/performance | |
parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip |
initial commit
Diffstat (limited to 'files/ko/web/api/performance')
-rw-r--r-- | files/ko/web/api/performance/index.html | 138 | ||||
-rw-r--r-- | files/ko/web/api/performance/mark/index.html | 101 | ||||
-rw-r--r-- | files/ko/web/api/performance/now/index.html | 99 |
3 files changed, 338 insertions, 0 deletions
diff --git a/files/ko/web/api/performance/index.html b/files/ko/web/api/performance/index.html new file mode 100644 index 0000000000..28e3a63c06 --- /dev/null +++ b/files/ko/web/api/performance/index.html @@ -0,0 +1,138 @@ +--- +title: Performance +slug: Web/API/Performance +tags: + - API + - Interface + - Navigation Timing + - NeedsTranslation + - Performance + - Reference + - TopicStub + - Web Performance +translation_of: Web/API/Performance +--- +<div>{{APIRef("High Resolution Time")}}</div> + +<p>The <strong><code>Performance</code></strong> interface represents timing-related performance information for the given page.</p> + +<p>An object of this type can be obtained by calling the {{domxref("Window.performance")}} read-only attribute.</p> + +<div class="note"> +<p><strong><em>Note</em>: </strong>This interface and its members are available in <a href="/en-US/docs/Web/API/Web_Workers_API">Web Workers</a>, except where indicated below. Note that some available parts of the interface are not yet documented (see the <a href="http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute">Performance Timeline</a> and <a href="http://www.w3.org/TR/user-timing/#extensions-performance-interface">User Timing</a> specs for more details.) Also note that performance markers and measures are per context. If you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa.</p> +</div> + +<h2 id="Properties">Properties</h2> + +<p><em>The <code>Performance</code> interface doesn't inherit any properties.</em></p> + +<dl> + <dt>{{domxref("Performance.navigation")}} {{readonlyInline}}</dt> + <dd>Is a {{domxref("PerformanceNavigation")}} object representing the type of navigation that occurs in the given browsing context, like the amount of redirections needed to fetch the resource. Not available in workers.</dd> + <dt>{{domxref("Performance.onframetimingbufferfull")}}</dt> + <dd>TBD</dd> + <dt>{{domxref("Performance.onresourcetimingbufferfull")}}</dt> + <dd>Is an {{domxref("EventTarget")}} which is a callback that will be called when the {{event("resourcetimingbufferfull")}} event is fired.</dd> + <dt>{{domxref("Performance.timing")}} {{readonlyInline}}</dt> + <dd>Is a {{domxref("PerformanceTiming")}} object containing latency-related performance information. Not available in workers.</dd> +</dl> + +<h2 id="Methods">Methods</h2> + +<p><em><em>The <code>Performance</code> interface doesn't inherit any </em>method</em>.</p> + +<dl> + <dt>{{domxref("Performance.clearFrameTimings()")}}</dt> + <dd>TBD</dd> + <dt>{{domxref("Performance.clearMarks()")}}</dt> + <dd>Removes the given <em>mark</em> from the browser's performance entry buffer.</dd> + <dt>{{domxref("Performance.clearMeasures()")}}</dt> + <dd>Removes the given <em>measure</em> from the browser's performance entry buffer.</dd> + <dt>{{domxref("Performance.clearResourceTimings()")}}</dt> + <dd>Removes all {{domxref("PerformanceEntry","performance entries")}} with a {{domxref("PerformanceEntry.entryType","entryType")}} of "<code>resource</code>" from the browser's performance data buffer.</dd> + <dt>{{domxref("Performance.getEntries()")}}</dt> + <dd>Returns a list of {{domxref("PerformanceEntry")}} objects based on the given <em>filter</em>.</dd> + <dt>{{domxref("Performance.getEntriesByName()")}}</dt> + <dd>Returns a list of {{domxref("PerformanceEntry")}} objects based on the given <em>name</em> and <em>entry type</em>.</dd> + <dt>{{domxref("Performance.getEntriesByType()")}}</dt> + <dd>Returns a list of {{domxref("PerformanceEntry")}} objects of the given <em>entry type</em>.</dd> + <dt>{{domxref("Performance.mark()")}}</dt> + <dd>Creates a {{domxref("DOMHighResTimeStamp","timestamp")}} in the browser's <em>performance entry buffer</em> with the given name.</dd> + <dt>{{domxref("Performance.measure()")}}</dt> + <dd>Creates a named {{domxref("DOMHighResTimeStamp","timestamp")}} in the browser's performance entry buffer between two specified marks (known as the <em>start mark</em> and <em>end mark</em>, respectively).</dd> + <dt>{{domxref("Performance.now()")}}</dt> + <dd>Returns a {{domxref("DOMHighResTimeStamp")}} representing the amount of milliseconds elapsed since a reference instant.</dd> + <dt>{{domxref("Performance.setFrameTimingBufferSize()")}}</dt> + <dd>TBD</dd> + <dt>{{domxref("Performance.setResourceTimingBufferSize()")}}</dt> + <dd>Sets the browser's resource timing buffer size to the specified number of "<code>resource</code>" {{domxref("PerformanceEntry.entryType","type")}} {{domxref("PerformanceEntry","performance entry")}} objects.</dd> + <dt>{{domxref("Performance.toJSON()")}}</dt> + <dd>Is a jsonizer returning a json object representing the <code>Performance</code> object.</dd> +</dl> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Highres Time Level 2', '#the-performance-interface', 'toJSON()')}}</td> + <td>{{Spec2('Highres Time Level 2')}}</td> + <td>Defines <code>toJson()</code> method.</td> + </tr> + <tr> + <td>{{SpecName('Highres Time', '#the-performance-interface', 'Performance')}}</td> + <td>{{Spec2('Highres Time')}}</td> + <td>Defines <code>now()</code> method.</td> + </tr> + <tr> + <td>{{SpecName('Navigation Timing', '#sec-window.performance-attribute', 'Performance')}}</td> + <td>{{Spec2('Navigation Timing')}}</td> + <td>Defines <code>timing</code> and <code>navigation</code> properties.</td> + </tr> + <tr> + <td>{{SpecName('Performance Timeline Level 2', '#extensions-to-the-performance-interface', 'Performance extensions')}}</td> + <td>{{Spec2('Performance Timeline Level 2')}}</td> + <td>Changes <code>getEntries()</code> interface.</td> + </tr> + <tr> + <td>{{SpecName('Performance Timeline', '#sec-window.performance-attribute', 'Performance extensions')}}</td> + <td>{{Spec2('Performance Timeline')}}</td> + <td>Defines <code>getEntries()</code>, <code>getEntriesByType()</code> and <code>getEntriesByName()</code> methods.</td> + </tr> + <tr> + <td>{{SpecName('Resource Timing', '#extensions-performance-interface', 'Performance extensions')}}</td> + <td>{{Spec2('Resource Timing')}}</td> + <td>Defines <code>clearResourceTimings()</code> and <code>setResourceTimingBufferSize()</code> methods and the <code>onresourcetimingbufferfull</code> property.</td> + </tr> + <tr> + <td>{{SpecName('User Timing Level 2', '#extensions-performance-interface', 'Performance extensions')}}</td> + <td>{{Spec2('User Timing Level 2')}}</td> + <td>Clarifies <code>mark()</code>, <code>clearMark()</code>, <code>measure()</code> and <code>clearMeasure()</code> methods.</td> + </tr> + <tr> + <td>{{SpecName('User Timing', '#extensions-performance-interface', 'Performance extensions')}}</td> + <td>{{Spec2('User Timing')}}</td> + <td>Defines <code>mark()</code>, <code>clearMark()</code>, <code>measure()</code> and <code>clearMeasure()</code> methods.</td> + </tr> + <tr> + <td>{{SpecName('<span style="line-height: 1.5;">Frame Timing', '#extensions-performance-interface','Performance extensions')}}</span></td> + <td>{{Spec2('User Timing')}}</td> + <td>Defines <code>clearFrameTimings()</code>, <code>setFrameTimingBufferSize()</code>, and <code>onframetimingbufferfull</code> methods.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<div> +<div> + + +<p>{{Compat("api.Performance")}}</p> +</div> +</div> diff --git a/files/ko/web/api/performance/mark/index.html b/files/ko/web/api/performance/mark/index.html new file mode 100644 index 0000000000..7c4261e1ba --- /dev/null +++ b/files/ko/web/api/performance/mark/index.html @@ -0,0 +1,101 @@ +--- +title: performance.mark() +slug: Web/API/Performance/mark +tags: + - API + - Method + - Reference + - Web Performance +translation_of: Web/API/Performance/mark +--- +<div>{{APIRef("User Timing API")}}</div> + +<p><strong><code>mark()</code></strong> 메소드는 브라우저의 <em>performance entry buffer</em>에 주어진 이름으로 {{domxref("DOMHighResTimeStamp","timestamp")}}를 생성합니다. timestamp가 정의된 응용프로그램은 {{domxref("Performance")}} 인터페이스의 <code>getEntries*()</code> 메소드들을 통해 불러올 수 있습니다. ({{domxref("Performance.getEntries","getEntries()")}}, {{domxref("Performance.getEntriesByName","getEntriesByName()")}}, {{domxref("Performance.getEntriesByType","getEntriesByType()")}}).</p> + +<p>{{AvailableInWorkers}}</p> + +<p><code>mark</code>의 {{domxref("PerformanceEntry","performance entry")}}는 다음 속성값을 갖습니다:</p> + +<ul> + <li>{{domxref("PerformanceEntry.entryType","entryType")}} - "<code>mark</code>"로 설정됩니다.</li> + <li>{{domxref("PerformanceEntry.name","name")}} - mark가 생성될 때 주어진 "<code>name</code>"으로 설정됩니다.</li> + <li>{{domxref("PerformanceEntry.startTime","startTime")}} - <code>mark()</code>가 호출되었을 때의 {{domxref("DOMHighResTimeStamp","timestamp")}}가 설정됩니다.</li> + <li>{{domxref("PerformanceEntry.duration","duration")}} - "<code>0</code>"으로 설정됩니다. (<em>duration</em>이 없는 mark).</li> +</ul> + +<p>만약 메서드에 주어진 <code>name</code>이 이미 {{domxref("PerformanceTiming")}} 인터페이스 상에 존재한다면 {{jsxref("SyntaxError")}}를 throw 합니다.</p> + +<h2 id="Syntax">Syntax</h2> + +<pre class="syntaxbox"><em>performance</em>.mark(name); +</pre> + +<h3 id="Arguments">Arguments</h3> + +<dl> + <dt>name</dt> + <dd>mark의 이름을 나타내는 {{domxref("DOMString")}}.</dd> +</dl> + +<h3 id="Return_value">Return value</h3> + +<dl> + <dt>void</dt> + <dd></dd> +</dl> + +<h2 id="Example">Example</h2> + +<p>다음 예시는 mark()를 사용하여 {{domxref("PerformanceMark")}}를 생성하고 불러오는 방법을 보여줍니다.</p> + +<pre class="brush:js">// Create a bunch of marks. +performance.mark("squirrel"); +performance.mark("squirrel"); +performance.mark("monkey"); +performance.mark("monkey"); +performance.mark("dog"); +performance.mark("dog"); + +// Get all of the PerformanceMark entries. +const allEntries = performance.getEntriesByType("mark"); +console.log(allEntries.length); +// 6 + +// Get all of the "monkey" PerformanceMark entries. +const monkeyEntries = performance.getEntriesByName("monkey"); +console.log(monkeyEntries.length); +// 2 + +// Clear out all of the marks. +performance.clearMarks(); +</pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('User Timing Level 2', '#dom-performance-mark', 'mark()')}}</td> + <td>{{Spec2('User Timing Level 2')}}</td> + <td>Clarifies <code>mark()</code> processing model.</td> + </tr> + <tr> + <td>{{SpecName('User Timing', '#dom-performance-mark', 'mark()')}}</td> + <td>{{Spec2('User Timing')}}</td> + <td>Basic definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<div> + + +<p>{{Compat("api.Performance.mark")}}</p> +</div> diff --git a/files/ko/web/api/performance/now/index.html b/files/ko/web/api/performance/now/index.html new file mode 100644 index 0000000000..f252b19a85 --- /dev/null +++ b/files/ko/web/api/performance/now/index.html @@ -0,0 +1,99 @@ +--- +title: performance.now() +slug: Web/API/Performance/now +tags: + - Performance + - performance.now +translation_of: Web/API/Performance/now +--- +<div>{{APIRef("High Resolution Timing")}}</div> + +<p>The <code><strong>performance.now()</strong></code> method returns a {{domxref("DOMHighResTimeStamp")}}, measured in milliseconds.</p> + +<div class="warning"> +<p>The timestamp is not actually high-resolution. To mitigate security threats such as <a href="https://spectreattack.com/">Spectre</a>, browsers currently round the results to varying degrees. (Firefox started rounding to 1 millisecond in Firefox 60.) Some browsers may also slightly randomize the timestamp. The precision may improve again in future releases; browser developers are still investigating these timing attacks and how best to mitigate them.</p> +</div> + +<p>{{AvailableInWorkers}}</p> + +<p>The returned value represents the time elapsed since the <a href="/en-US/docs/Web/API/DOMHighResTimeStamp#The_time_origin">time origin</a>.</p> + +<p>Bear in mind the following points:</p> + +<ul> + <li>In dedicated workers created from a {{domxref("Window")}} context, the value in the worker will be lower than <code>performance.now()</code> in the window who spawned that worker. It used to be the same as <code>t0</code> of the main context, but this was changed.</li> + <li>In shared or service workers, the value in the worker might be higher than that of the main context because that window can be created after those workers.</li> +</ul> + +<h2 id="Syntax">Syntax</h2> + +<pre class="syntaxbox"><em>t</em> = performance.now();</pre> + +<h2 id="Example">Example</h2> + +<pre class="brush: js">var t0 = performance.now(); +doSomething(); +var t1 = performance.now(); +console.log("Call to doSomething took " + (t1 - t0) + " milliseconds."); +</pre> + +<p>Unlike other timing data available to JavaScript (for example <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Date/now"><code>Date.now</code></a>), the timestamps returned by <code>performance.now()</code> are not limited to one-millisecond resolution. Instead, they represent times as floating-point numbers with up to microsecond precision.</p> + +<p>Also unlike <code>Date.now()</code>, the values returned by <code>performance.now() </code>always increase at a constant rate, independent of the system clock (which might be adjusted manually or skewed by software like NTP). Otherwise, <code>performance.timing.navigationStart + performance.now() </code>will be approximately equal to<code> Date.now()</code>.</p> + +<h2 id="Reduced_time_precision">Reduced time precision</h2> + +<p>To offer protection against timing attacks and fingerprinting, the precision of <code>performance.now()</code> might get rounded depending on browser settings.<br> + In Firefox, the <code>privacy.reduceTimerPrecision</code> preference is enabled by default and defaults to 1ms.</p> + +<pre class="brush: js">// reduced time precision (1ms) in Firefox 60 +performance.now(); +// 8781416 +// 8781815 +// 8782206 +// ... + + +// reduced time precision with `privacy.resistFingerprinting` enabled +performance.now(); +// 8865400 +// 8866200 +// 8866700 +// ... +</pre> + +<p>In Firefox, you can also enable <code>privacy.resistFingerprinting</code> — this changes the precision to 100ms or the value of <code>privacy.resistFingerprinting.reduceTimerPrecision.microseconds</code>, whichever is larger.</p> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Highres Time Level 2', '#dom-performance-now', 'performance.now()')}}</td> + <td>{{Spec2('Highres Time Level 2')}}</td> + <td>Stricter definitions of interfaces and types.</td> + </tr> + <tr> + <td>{{SpecName('Highres Time', '#dom-performance-now', 'performance.now()')}}</td> + <td>{{Spec2('Highres Time')}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.Performance.now")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="http://updates.html5rocks.com/2012/08/When-milliseconds-are-not-enough-performance-now">When milliseconds are not enough: performance.now() </a>from HTML5 Rocks.</li> +</ul> |