加个这玩意
This commit is contained in:
parent
5a6e38274d
commit
c02ac6234f
@ -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*/];
|
||||
}
|
||||
});
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user