Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
 
// noprotect
var ini, fin;
ini = new Date().getTime();
for (var i = 0; i < 1000; i++)
    $("body").on("click", function(){});
fin = new Date().getTime();
console.log(".on(): " + (fin - ini));
ini = new Date().getTime();
for (var i = 0; i < 1000; i++)
    $("body").click(function(){});
fin = new Date().getTime();
console.log(".click(): " + (fin - ini));
ini = new Date().getTime();
for (var i = 0; i < 10000; i++)
    $("body").on("click", function(){});
fin = new Date().getTime();
console.log(".on(): " + (fin - ini));
ini = new Date().getTime();
for (var i = 0; i < 10000; i++)
    $("body").click(function(){});
fin = new Date().getTime();
console.log(".click(): " + (fin - ini));
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
Alexis88pro
0viewers