Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
function uuid() {
    function randomDigit() {
        if (crypto && crypto.getRandomValues) {
            var rands = new Uint8Array(1);
            crypto.getRandomValues(rands);
            return (rands[0] % 16).toString(16);
        } else {
            return ((Math.random() * 16) | 0).toString(16);
        }
    }
    var crypto = window.crypto || window.msCrypto;
    return 'xxxxxxxx-xxxx-4xxx-8xxx-xxxxxxxxxxxx'.replace(/x/g, randomDigit);
}
var count = 0;
var start = (new Date()).getTime();
while (((new Date()).getTime() - start) < 1000) { // noprotect
    for (var i = 0; i < 100; i++) {
        uuid();
        count++;
    }
}
console.log(count);
var div = document.createElement('div');
div.textContent = '' + count + ' per second';
document.body.appendChild(div);
Output

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

Dismiss x
public
Bin info
robocatpro
0viewers