Home > jquery.profiler

jquery.profiler

Jquery.profiler is a project mainly written in JavaScript, it's free.

jquery.profiler allows you to profile your javascript code on browsers without a full support of console.time and console.timeEnd methods such as Mobile Safari.

h1. Basics

jquery.profiler allows you to profile your javascript code on browsers without a full support of console.time and console.timeEnd methods such as Mobile Safari.

It is compatible with both jQuery and Zepto frameworks.

h1. Syntax

There are 3 basic methods you can use to profile:

  • $.profiler.lasts(function, [name])
  • $.profiler.time([name])
  • $.profiler.timeEnd([name])

All these methods outputs into standard console in milliseconds.

$.profiler.lasts(function) takes a function as argument which is useful to profile query selectors etc.

$.profiler.time() and $.profiler.timeEnd() are mimic to console.time() and console.timeEnd() introduced in Firebug (http://getfirebug.com/logging).

h2. Standard console

As a shorthand you can also use standard console object as:

  • console.time(name)
  • console.timeEnd(name)