From c02ac6234f652b008f2704aa550620864ce1aec3 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Fri, 10 May 2024 23:01:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=AA=E8=BF=99=E7=8E=A9=E6=84=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ica-rs/plugins/md5/md5-api.js | 7 +++++-- ica-rs/plugins/md5/md5-api.ts | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ica-rs/plugins/md5/md5-api.js b/ica-rs/plugins/md5/md5-api.js index 289213a..5824cbf 100644 --- a/ica-rs/plugins/md5/md5-api.js +++ b/ica-rs/plugins/md5/md5-api.js @@ -207,17 +207,20 @@ function wrap_any(names, round) { } function main() { return __awaiter(this, void 0, void 0, function () { - var fs, path, names, result; + var fs, path, names, start_time, result, end_time; return __generator(this, function (_a) { switch (_a.label) { case 0: fs = require("fs"); path = require("path"); names = fs.readFileSync(path.resolve(__dirname, "input.txt"), "utf-8"); - return [4 /*yield*/, wrap_any(names, 1000)]; + start_time = Date.now(); + return [4 /*yield*/, wrap_any(names, 10000)]; case 1: result = _a.sent(); + end_time = Date.now(); console.log(result); + console.log("Node.js \u8017\u65F6: ".concat(end_time - start_time, " ms")); return [2 /*return*/]; } }); diff --git a/ica-rs/plugins/md5/md5-api.ts b/ica-rs/plugins/md5/md5-api.ts index 3638c86..99c3259 100644 --- a/ica-rs/plugins/md5/md5-api.ts +++ b/ica-rs/plugins/md5/md5-api.ts @@ -195,8 +195,11 @@ async function main() { // const result = await fight(names); // const result = await md5_module.run_any(names, 50000); // console.log(`赢家:|${result.source_plr}|`); - const result = await wrap_any(names, 1000); + const start_time = Date.now(); + const result = await wrap_any(names, 10000); + const end_time = Date.now(); console.log(result); + console.log(`Node.js 耗时: ${end_time - start_time} ms`); } main();