performance는 자바스크립트에서 내장된 객체로, 성능 측정과 관련된 고해상도 시간을 제공하는 API를 지원합니다. performance 객체는 생성자 함수가 아니라, 브라우저 환경에서 전역적으로 사용 가능한 내장 객체입니다.
const startTime = performance.now();
// 작업 수행
const endTime = performance.now();
console.log(`작업 시간: ${endTime - startTime} 밀리초`);
console.log(performance.memory);
console.log(performance.timeOrigin);
performance.clearMarks('myMark');
performance.clearMeasures('myMeasure');
console.log(performance.getEntries());
console.log(performance.getEntriesByType('mark'));
console.log(performance.getEntriesByName('myMark'));
이 메서드들을 사용하면 웹 애플리케이션의 성능을 정밀하게 측정하고 분석할 수 있습니다. performance 객체는 성능 최적화를 위한 중요한 도구로, 특히 복잡한 웹 애플리케이션의 성능 병목 지점을 찾는 데 유용합니다.
display="", display="block" (0) | 2024.11.21 |
---|---|
join(), splite() (4) | 2024.11.21 |
cloneNode() (0) | 2024.11.21 |
HTMLCollection, NodeList 비교 (2) | 2024.11.05 |
clientX, layerX, offsetX, pageX, x - 마우스 이벤트 객체의 좌표 속성 (1) | 2024.10.30 |