Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio">
  <input type="radio">
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  <input type="radio">
  <input type="radio" checked>
  
</body>
</html>
 
//noprotect
var start = new Date().getTime();
var count = 0;
for (var n = 0; n < 100000; n++) {
  count = $('input[type="radio"]').filter(':checked').length;
}
var elapsed = new Date().getTime() - start;
console.log(elapsed);
start = new Date().getTime();
for (n = 0; n < 100000; n++) {
  count = $('input[type="radio"]:checked').length;
}
elapsed = new Date().getTime() - start;
console.log(elapsed);
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers