id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id
title
category
status
canonical_id
aliases
duplicate_of
source_trust_level
confidence_score
verification_status
tags
raw_sources
last_reinforced
github_commit
tech_stack
wiki-2026-0508-high-resolution-time
High Resolution Time
10_Wiki/Topics
verified
self
performance.now
Monotonic Time
HR Time
Hi-Res Timer
none
A
0.9
applied
web-api
performance
timing
security
2026-05-10
pending
language
framework
JavaScript/C
W3C-HRTime/POSIX
High Resolution Time
매 한 줄
"매 sub-millisecond 정밀도의 매 monotonic clock" . W3C High Resolution Time spec — performance.now() 가 매 Date.now() 의 ms 한계 + wall-clock jitter 를 매 해결. 매 Spectre 후 — 모든 brower 가 매 timer 정밀도를 매 100µs ~ 1ms 로 매 reduce + cross-origin isolation 으로 매 5µs 회복.
매 핵심
매 vs Date.now
Date.now(): wall clock, ms 단위, NTP 으로 점프 가능 (음수 delta!).
performance.now(): monotonic, fractional ms, navigation start 기준.
매 timer attack mitigation
Spectre/Meltdown (2018) → 매 brower 가 timer fuzz/round.
Default: 100µs ~ 1ms rounding + jitter.
COOP+COEP (cross-origin isolated) 시 → 5µs 정밀 + SharedArrayBuffer.
매 응용
Animation frame timing (rAF callback).
Performance profiling (User Timing API).
WebGL/WebGPU frame budget tracking.
Audio scheduling (AudioContext.currentTime 동기).
💻 패턴
Basic timing
User Timing API (DevTools 표시)
Frame budget tracker
Cross-origin isolated (max precision)
POSIX equivalent (C)
Rust std (cross-platform)
Debounce slow timers
매 결정 기준
상황
Approach
Wall-clock event log
Date.now() / Date.toISOString()
Profile / micro-bench
performance.now() + User Timing
Frame loop
rAF callback timestamp (매 monotonic)
Audio sync
AudioContext.currentTime
Cross-origin iframe
postMessage with monotonic delta
Native (Linux/macOS)
clock_gettime(CLOCK_MONOTONIC)
Native (Windows)
QueryPerformanceCounter
기본값 : Duration 측정엔 매 monotonic. 매 Date 는 user-facing timestamp 만.
🔗 Graph
🤖 LLM 활용
언제 : 성능 측정 코드 작성, profiling, frame budget 분석.
언제 X : Persistent timestamp / event log 매 wall-clock 필요 시.
❌ 안티패턴
Date.now() for delta : NTP step 시 음수 / 점프 가능.
new Date() 매 hot loop : allocation cost + ms 한계.
Assuming sub-ms precision : COOP/COEP 없으면 매 1ms rounded.
Cross-origin worker timing : postMessage 의 매 ms 단위 transmit overhead.
setTimeout 으로 정밀 timing : 매 4ms+ minimum, jittery.
🧪 검증 / 중복
Verified (W3C HR Time Level 3, MDN performance.now, Chrome timer reduction notes).
신뢰도 A.
🕓 Changelog
날짜
변경
2026-05-08
Phase 1
2026-05-10
Manual cleanup — performance.now + Spectre mitigation + COOP/COEP 5µs