syntax
javaScriptBenchmark( what[, reportHandle] )
the what attribute provides the code you want to benchmark. It can be a string or a function handler.
the reportHandle attribute is optionnal and provides the handle of the HTML element where you want to output the report.
initializeJavaScriptBenchmark( what )
the what attribute provides the id of the javaScriptBenchmark you want to initialize.
updateJavaScriptBenchmark( what )
the what attribute provides the id of the javaScriptBenchmark you want to update.
examples
- javaScriptBenchmark( "for(var i=65536,j=0;i--;)j+=i;" )
- javaScriptBenchmark( "for(var i=65536,j=0;i--;)j+=i;", document.body.getElementById( 'reportArea' ) )
- javaScriptBenchmark( "uselessFunction( 17, -97 )" )
- javaScriptBenchmark( "uselessFunction( 17, -97 )", document.body.getElementById( 'reportArea' ) )
- javaScriptBenchmark( anyFunctionHandler, document.body.getElementById( 'reportArea' ) )
- initializeJavaScriptBenchmark( "stupid things" ); for(var i=65536,j=0;i--;)j+=i; updateJavaScriptBenchmark( "stupid things" );