Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit25312ad

Browse files
authored
Check how long an operation takes
1 parent8980e66 commit25312ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,13 @@ Array(6).join('👽')
9393
//👽👽👽👽👽👽
9494

9595
```
96+
#Check how long an operation takes
97+
```javascript
98+
//The performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds.
99+
//performance.now() is relative to page load and more precise in orders of magnitude. Use cases include benchmarking and other cases where a high-resolution time is required such as media (gaming, audio, video, etc.)
100+
101+
var startTime=performance.now();
102+
doSomething();
103+
constendTime=performance.now();
104+
console.log("this doSomething took"+ (endTime- startTime)+" milliseconds.");
105+
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp