node-query/node_modules/nodeunit/deps/ejs/benchmark.js

14 lines
326 B
JavaScript
Raw Normal View History

2014-10-20 16:56:45 -04:00
var ejs = require('./lib/ejs'),
str = '<% if (foo) { %><p><%= foo %></p><% } %>',
times = 50000;
console.log('rendering ' + times + ' times');
var start = new Date;
while (times--) {
ejs.render(str, { cache: true, filename: 'test', locals: { foo: 'bar' }});
}
console.log('took ' + (new Date - start) + 'ms');