perf.2.html 726 B

12345678910111213141516171819202122232425262728
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>HTML5 Shiv</title>
  6. <link rel="stylesheet" href="style.css">
  7. <script src="../src/html5shiv-printshiv.js"></script>
  8. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script>
  9. </head>
  10. <body>
  11. <div id="time"></div>
  12. <section>This sentence is in a green box <mark>with these words highlighted</mark>.</section>
  13. <script>
  14. function addDom(){
  15. document.createElement('div');
  16. document.createDocumentFragment();
  17. }
  18. var time = document.getElementById('time');
  19. var cur = new Date().getTime();
  20. for(var i = 0; i < 10000; i++){
  21. addDom();
  22. }
  23. time.innerHTML = new Date().getTime() - cur;
  24. </script>
  25. <body>
  26. </html>