mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Add simple scaffolding for profiling and timing execution.
This commit is contained in:
parent
85d720cefc
commit
604ff5df39
1 changed files with 18 additions and 0 deletions
18
test/profile-fixture.mjs
Normal file
18
test/profile-fixture.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { readFile } from "node:fs/promises";
|
||||
import library from "../lib/markdownlint.js";
|
||||
const markdownlint = library.promises.markdownlint;
|
||||
|
||||
const strings = {
|
||||
"CONTRIBUTING": await readFile("CONTRIBUTING.md", "utf8"),
|
||||
"README": await readFile("README.md", "utf8"),
|
||||
"CustomRules": await readFile("./doc/CustomRules.md", "utf8"),
|
||||
"Prettier": await readFile("./doc/Prettier.md", "utf8"),
|
||||
"Rules": await readFile("./doc/Rules.md", "utf8")
|
||||
};
|
||||
|
||||
const start = new Date();
|
||||
for (let i = 0; i < 250; i++) {
|
||||
await markdownlint({strings});
|
||||
}
|
||||
const end = new Date();
|
||||
console.log(`Elapsed: ${end - start}`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue