Search code examples
javascriptjqueryperformancedelay

javascript speed


On an average system, say

Processor: Core 2 Duo 2.2 GHz, Memory: 4 GB

How much DOM-manipulations can javascript make? Is there a way to see how long (in milliseconds) a simple jQuery action takes? For example one like:

$("#example").css("color","red");

Solution

  • If you're browser supports it, you could use console.profile(); before the call(s) and console.profileEnd(); after. You console should show you output how long it took, the number of calls, etc.

    console.profile();
    $("#example").css("color","red");
    console.profileEnd();
    

    Nettuts+ has a tutorial here.