mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
- all tests should be under perf/ - all payloads should be under perf/data - run tests with ./server.sh + ./test-perf.sh We still lack a way to compare results against a baseline, but this is better than nothing.
20 lines
No EOL
324 B
JavaScript
20 lines
No EOL
324 B
JavaScript
if (window.jstestdriver) {
|
|
jstd = jstestdriver;
|
|
dump = angular.bind(jstd.console, jstd.console.log);
|
|
}
|
|
|
|
function time(fn, times) {
|
|
times = times || 1;
|
|
|
|
var i,
|
|
start,
|
|
duration = 0;
|
|
|
|
for (i=0; i<times; i++) {
|
|
start = Date.now();
|
|
fn();
|
|
duration += Date.now() - start;
|
|
}
|
|
|
|
return duration;
|
|
} |