Track DOM Load Speed
by darcyclarke
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta property="fb:admins" content="1112144" />
<title>Speed Up Your Javascript Load Time | BetterExplained</title>
<link rel="stylesheet" type="text/css" media="screen" href="http://betterexplained.com/wp-content/themes/be-v8/style.css" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://betterexplained.com/feed/" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="pingback" href="http://betterexplained.com/xmlrpc.php" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript" />
<link rel="alternate" type="application/rss+xml" title="BetterExplained » Speed Up Your Javascript Load Time Comments Feed" href="http://betterexplained.com/articles/speed-up-your-javascript-load-time/feed/" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://betterexplained.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://s3.amazonaws.com/betterexplained-cdn/wp-includes/wlwmanifest.xml" />
<link rel='index' title='BetterExplained' href='http://betterexplained.com/' />
<link rel='start' title='Welcome to BetterExplained!' href='http://betterexplained.com/articles/hello-world/' />
<link rel='prev' title='Vector Calculus: Understanding Circulation and Curl' href='http://betterexplained.com/articles/vector-calculus-understanding-circulation-and-curl/' />
<link rel='next' title='A Simple, Comprehensive Overview of Javascript' href='http://betterexplained.com/articles/the-single-page-javascript-overview/' />
<meta name="generator" content="WordPress 3.0.4" />
<link rel='canonical' href='http://betterexplained.com/articles/speed-up-your-javascript-load-time/'...
JavaScript
// uncompressed
(function(){
var start = new Date(), end;
jQuery(function($){
end = ((new Date())-start)+"ms";
console.log(end);
});
})();
// compressed
(function(){var a=new Date,b;jQuery(function(c){b=new Date-a+"ms";console.log(b)})})()