Skip to content

Commit acd7eef

Browse files
committed
RENDER_STYLES_TIMEOUT_THRESHOLD
1 parent 5cd0158 commit acd7eef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/Perfomance.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import config from '../config';
44
import ReactTooltip from 'react-tooltip';
55

66
let metrics = [];
7+
const RENDER_STYLES_TIMEOUT_THRESHOLD = 500;
78

89
class Perfomance extends Component {
910
state = {
@@ -31,7 +32,7 @@ class Perfomance extends Component {
3132
setTimeout(() => {
3233
const didMountTime = parseInt(time, 10);
3334
const renderStylesTime = parseInt(
34-
(now() - this.createdAt).toFixed(0),
35+
(now() - this.createdAt - RENDER_STYLES_TIMEOUT_THRESHOLD).toFixed(0),
3536
10
3637
);
3738

@@ -75,7 +76,7 @@ class Perfomance extends Component {
7576
console.log(metrics);
7677
metrics = [];
7778
}
78-
});
79+
}, RENDER_STYLES_TIMEOUT_THRESHOLD);
7980
}
8081

8182
render() {

0 commit comments

Comments
 (0)