Firebug profiling issue: "no activity for profile"

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");

        //retrieve the charcode if possible, otherwise get the keycode
        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?

+3
source share
3 answers

Firebug , , .

+3

, . console.time?

from http://getfirebug.com/logging

Firebug : JavaScript. - console.time( "timing foo" ) , , console.timeEnd( "timing foo" ) . Firebug , .

JavaScript. console.profile() , console.profileEnd() . Firebug , .

+1

Turn on profiling before running code?

Click "Firebug> console> profile

A message should appear in the firebug message: "The profiler is working. Click" Profile "again to view its report."

NTN

0
source

Source: https://habr.com/ru/post/1742273/


All Articles