Skip to content

Instantly share code, notes, and snippets.

@tomfuertes
Created July 30, 2019 15:07
Show Gist options
  • Save tomfuertes/81584eed48017b191d78634cfaa4e1e9 to your computer and use it in GitHub Desktop.
Save tomfuertes/81584eed48017b191d78634cfaa4e1e9 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/vahocedapo
<!DOCTYPE html>
<html>
<head>
<script>
window.start = new Date();
function log(str){
return ()=>{
console.log(str, document.readyState, new Date() - start);
if (document.readyState === 'interactive') {
console.log(document.getElementById('foo').style);
}
}
}
document.addEventListener('readystatechange', log('rsc'));
window.addEventListener('load', log('load'));
log('top')();
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1 id="foo">foo</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment