blob: e9f86c8756c3caab70a9cdba8094d3efee829940 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
---
title: BatteryManager.chargingTime (배터리관리기 충전시간)
slug: Web/API/BatteryManager/chargingTime
tags:
- API
- Battery API
- 목적
- 참조
translation_of: Web/API/BatteryManager/chargingTime
---
<div>{{obsolete_header}}</div>
<p>{{APIRef("Battery API")}}</p>
<p>몇 초 단위로, 배터리가 완전히 충전될 때까지 남은 시간량을 가리킵니다.</p>
<div class="note">
<p>반환되는 시간이 정확하더라도, 개인정보보호 정책 사유로 브라우저들이 더 큰 간격(대개 15분)으로 시간량을 반올림합니다.</p>
</div>
<pre class="syntaxbox notranslate">var <em>time</em> = battery.chargingTime</pre>
<p>반환되는 중에, 건전지가 완전히 충전될 때까지 또는 이미 완전히 충전되어 있다면 0이 될 때까지 <code>time</code> 은 몇 초 뒤에 남게 되는 시간입니다. 이는 {{domxref("BatteryManager")}} object (객체),입니다. 배터리의 전류가 방전되어 있다면, 이 값은 <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Infinity">Infinity</a></code>, 즉 무한 값이 됩니다.</p>
<h2 id="Example" name="Example">예제</h2>
<h3 id="HTML_콘텐츠">HTML 콘텐츠</h3>
<pre class="brush: html notranslate"><div id="chargingTime">(charging time unknown)</div>
</pre>
<h3 id="자바언어_콘텐츠">자바언어 콘텐츠</h3>
<pre class="brush: js; highlight:[3] notranslate">navigator.getBattery().then(function(battery) {
var time = battery.chargingTime;
document.querySelector('#chargingTime').textContent = battery.chargingTime;
});
</pre>
<p>{{ EmbedLiveSample('Example', '100%', 30) }}</p>
<h2 id="설명서">설명서</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">사양 (설명)</th>
<th scope="col">상태 (설명)</th>
<th scope="col">관련 (설명)</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName("Battery API")}}</td>
<td>{{Spec2("Battery API")}}</td>
<td>최초 정의</td>
</tr>
</tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<p>{{Compat("api.BatteryManager.chargingTime")}}</p>
<h2 id="같이_보세요">같이 보세요</h2>
<ul>
<li>{{domxref("BatteryManager")}}</li>
<li>{{domxref("Navigator.getBattery")}}</li>
</ul>
|