Created
April 14, 2009 22:50
-
-
Save richcollins/95479 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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