Print task run duration time

This commit is contained in:
SukkaW
2023-09-13 14:07:38 +08:00
parent 09c8b62f6a
commit 9f05105b29
17 changed files with 96 additions and 92 deletions

View File

@@ -172,7 +172,12 @@ const ADGUARD_FILTERS = /** @type {const} */([
// GameConsoleAdblockList
'https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt',
// PiHoleBlocklist
'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt',
[
'https://perflyst.github.io/PiHoleBlocklist/SmartTV-AGH.txt',
[
'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt'
]
],
// Spam404
'https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt',
// BarbBlock

15
Build/lib/trace-runner.js Normal file
View File

@@ -0,0 +1,15 @@
const path = require('path');
/**
* @param {Function} fn
* @param {string} __filename
*/
module.exports.runner = async (__filename, fn) => {
const runnerName = path.basename(__filename, path.extname(__filename));
const start = Date.now();
const result = await fn();
const end = Date.now();
console.log(`⌛ [${runnerName}]: ${end - start}ms`);
return result;
};