aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/ejs/benchmark.js
blob: 7b267e1603f2cad7894aa05b5641dc74e6302ccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

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');