jweinst1
4/4/2016 - 5:11 AM

times a function in javascript

times a function in javascript

//count substrs in  in a string

function countpattern() {
	var start = Date.now();
	var count = [];
	for(var i=0;i<20000;i++) {
		count.push(1);
	}
	var end = Date.now();
	return end - start;
}