marked/test/bench.js
Christopher Jeffrey ccfc53b4a3 marked down
2011-07-24 08:15:35 -05:00

24 lines
512 B
JavaScript
Executable File

var fs = require('fs')
, text = fs.readFileSync(__dirname + '/in.md', 'utf8');
var benchmark = function(func, t) {
var start = new Date()
, i = t || 10000;
while (i--) func();
console.log('%s: %sms', func.name, new Date() - start);
};
var md_ = require('../');
benchmark(function md() {
md_(text);
});
var showdown_ = require('showdown');
benchmark(function showdown() {
showdown_(text);
});
var markdown_ = require('markdown');
benchmark(function markdownjs() {
markdown_.toHTML(text);
});