Baseline Widely available
Date.now()
ì ì ë©ìëë, UTC 기ì¤ì¼ë¡ 1970ë
1ì 1ì¼ 0ì 0ë¶ 0ì´ì¸ epochë¶í° íì¬ê¹ì§ 경과ë ë°ë¦¬ì´ë¥¼ ë°íí©ëë¤.
// This example takes 2 seconds to run
const start = Date.now();
console.log("starting timer...");
// Expected output: "starting timer..."
setTimeout(() => {
const millis = Date.now() - start;
console.log(`seconds elapsed = ${Math.floor(millis / 1000)}`);
// Expected output: "seconds elapsed = 2"
}, 2000);
구문 매ê°ë³ì
ìì
ë°í ê°íì¬ ìê°ì ë°ë¦¬ì´ íìì¤í¬íë¡ ëíë´ë ì«ìì ëë¤.
ì¤ëª ê°ìí ìê° ì ë°ëíì´ë° 공격 ë° íê±°í린í
ì ëí ë³´í¸ë¥¼ ì ê³µí기 ìí´, Date.now()
ì ì ë°ëë ë¸ë¼ì°ì ì¤ì ì ë°ë¼ ë°ì¬ë¦¼ë ì ììµëë¤. Firefoxììë privacy.reduceTimerPrecision
ì¤ì ì´ ê¸°ë³¸ì ì¼ë¡ íì±íëì´ ìì¼ë©°, 2msë¡ ì¤ì ëì´ ììµëë¤. privacy.resistFingerprinting
ì íì±íí ìë ìëë°, ì´ ê²½ì° ì ë°ëë 100ms ëë privacy.resistFingerprinting.reduceTimerPrecision.microseconds
ê° ì¤ ë í° ê°ì´ ë©ëë¤.
ì를 ë¤ì´, privacy.resistFingerprinting
ì´ íì±íë ê²½ì°, ìê° ì ë°ëê° ê°ìíë©° Date.now()
ì ê²°ê³¼ë íì 2ì ë°°ì ëë 100ì ë°°ì(ëë privacy.resistFingerprinting.reduceTimerPrecision.microseconds
)ê° ë©ëë¤.
// Firefox 60ìì ê°ìí ìê° ì ë°ë (2ms)
Date.now();
// ê°ì ìë§ë ìëì ê°ìµëë¤.
// 1519211809934
// 1519211810362
// 1519211811670
// â¦
// `privacy.resistFingerprinting`를 íì±íí´ ê°ìí ìê° ì ë°ë
Date.now();
// ê°ì ìë§ë ìëì ê°ìµëë¤.
// 1519129853500
// 1519129858900
// 1519129864400
// â¦
ìì 경과ìê° ì¸¡ì
Date.now()
를 ì¬ì©íë©´ íì¬ ìê°ì ë°ë¦¬ì´ ë¨ìë¡ êµ¬í ì ìì¼ë©°, ê·¸ë° ë¤ì ì´ì ìê°ì 빼면 ë í¸ì¶ ì¬ì´ì 경과í ìê°ì ììë¼ ì ììµëë¤.
const start = Date.now();
doSomeLongRunningProcess();
console.log(`Time elapsed: ${Date.now() - start} ms`);
ë ë³µì¡í ìë리ì¤ì ê²½ì° ëì í¼í¬ë¨¼ì¤ API를 ì¬ì©í ì ììµëë¤.
ëª ì¸ ë¸ë¼ì°ì í¸íì± ê°ì´ 보기RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4