Skip to content

Instantly share code, notes, and snippets.

@richcollins
Created April 14, 2009 22:50
Show Gist options
  • Select an option

  • Save richcollins/95479 to your computer and use it in GitHub Desktop.

Select an option

Save richcollins/95479 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "en" lang = "en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
window.onload = function()
{
var body = document.getElementsByTagName("body")[0];
var frames = 0;
var timeInFrames = 0;
var s = "a fairly long bit of html";
function setHTML()
{
if(new Date - start < 1000)
{
var frameStart = new Date;
body.innerHTML = s;
frames ++;
timeInFrames += (new Date - frameStart);
setTimeout(setHTML, 0);
}
else
{
alert("rendered " + frames + " in " + timeInFrames + " ms over " + (new Date - start) + " ms");
}
}
var start = new Date;
setHTML();
}
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment