added profile func, shorter getRecentReplies

This commit is contained in:
Baris Soner Usakli
2014-01-14 19:23:27 -05:00
parent 466c02a886
commit c94da47ae8
2 changed files with 21 additions and 20 deletions

View File

@@ -6,6 +6,12 @@
if ('undefined' === typeof window) {
fs = require('fs');
XRegExp = require('xregexp').XRegExp;
process.profile = function(operation, start) {
var diff = process.hrtime(start);
console.log('%s took %d milliseconds', operation, diff[0] * 1e3 + diff[1] / 1e6);
}
} else {
XRegExp = window.XRegExp;
}