Javascript benchmarkLicense

In computing, a benchmark is the result of running a computer program or a function, or a set of functions, in order to assess the relative performance of an object, by running a number of standard tests and trials against it.

This is a method which can be used to do a relative measure (benchmark) of the Javascript function performance. If you have some function (lets say ‘test()’, and you regularly call it like this ‘test(1,2,3)’) which performance you want to measure, just call it in this way:

test.benchmark('function - test', 1000, [1,2,3]);

  • First argument is the name of your benchmark
  • Second is how many times you want to call it
  • Third is the array of you usual arguments


Source code for webtoolkit.benchmark.js