reddit plugin refactoring, performance improvemnts etc.

This commit is contained in:
azivner
2018-01-13 15:25:09 -05:00
parent ccd222cf12
commit a375c55371
5 changed files with 103 additions and 88 deletions

View File

@@ -99,6 +99,16 @@ function assertArguments() {
}
}
async function stopWatch(what, func) {
const start = new Date();
await func();
const tookMs = new Date().getTime() - start.getTime();
console.log(`${what} took ${tookMs}ms`);
}
module.exports = {
randomSecureToken,
randomString,
@@ -119,5 +129,6 @@ module.exports = {
isEmptyOrWhitespace,
getDateTimeForFile,
sanitizeSql,
assertArguments
assertArguments,
stopWatch
};