Adjust template

Signed-off-by: Tobias Berger <tobi.berger13@gmail.com>
This commit is contained in:
Tobias Berger 2020-12-17 12:51:38 +01:00
parent b5326798ac
commit 17b09ad475
Signed by: toby
GPG key ID: 2D05EFAB764D6A88
2 changed files with 14 additions and 6 deletions

View file

@ -10,8 +10,12 @@ async function main(data) {
} }
fs.readFile("input", (err, data) => { fs.readFile("input", (err, data) => {
console.time("Part 1") console.time("Part 1");
if (err) throw err; if (err) throw err;
main(data.toString()).then(console.log).catch(console.error); main(data.toString())
console.timeEnd("Part 1") .then((...args) => {
console.log(...args);
console.timeEnd("Part 1");
})
.catch(console.error);
}); });

View file

@ -10,8 +10,12 @@ async function main(data) {
} }
fs.readFile("input", (err, data) => { fs.readFile("input", (err, data) => {
console.time("Part 2") console.time("Part 2");
if (err) throw err; if (err) throw err;
main(data.toString()).then(console.log).catch(console.error); main(data.toString())
console.timeEnd("Part 2") .then((...args) => {
console.log(...args);
console.timeEnd("Part 2");
})
.catch(console.error);
}); });