3 var timeSafeCompare = require('../../lib/index');
5 function random(length) {
9 var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-+/*[]{}-=\|;\':\"<>?,./";
11 for( var i=0; i < length; i++ ){
12 result += possible.charAt(Math.floor(Math.random() * possible.length));
18 count = count || 100*1000;
19 console.log('benchmark count: ' + count/1000 + 'k');
20 console.time('benchmark');
23 timeSafeCompare(random(), random());
25 console.timeEnd('benchmark');