I want to try several different options using javascript (jQuery) to find out which one is the fastest, however I cannot profile profiling correctly. Here is the code I want to test.
$this.keypress(function(e) {
console.profile("test");
k = e.which ? e.which : e.CharCode;
if (blockKeyCodes.indexOf("|" + k + "|") != -1 || e.ctrlKey && k == 86)
e.preventDefault();
console.profileEnd();
});
However, when I run this, the console states "no activity for profile." If I use console.time, the result is 0 ms.
Does anyone know how to fix this?
source
share