Skip to content

Latest commit

 

History

History
26 lines (15 loc) · 835 Bytes

README.textile

File metadata and controls

26 lines (15 loc) · 835 Bytes

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.

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).

Standard console

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

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