Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"pretty-ms": "9.3.0"
},
"devDependencies": {
"@eslint/js": "9.39.1",
"@eslint/js": "9.39.2",
"@types/node": "25.0.0",
"@typescript-eslint/eslint-plugin": "8.49.0",
"@typescript-eslint/parser": "8.49.0",
Expand Down
52 changes: 26 additions & 26 deletions src/timing.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import prettyMilliseconds from "pretty-ms";
import styleText from "node-style-text";
const START_PREFIX = styleText.bgGray("[START]");
const END_PREFIX = styleText.bgGreen("[ END ]");
class Timing {
#message;
#startMark: PerformanceMark | undefined;
constructor(message: string) {
this.#message = message;
this.#startMark = performance.mark("start");
console.log(`${START_PREFIX}: ${message}`);
}
end(message?: string) {
const { duration } = performance.measure(this.#message, this.#startMark);
console.log(
(message ?? `${END_PREFIX}: ${this.#message}`) +
` (${styleText.blue.underline(prettyMilliseconds(duration))})`,
);
}
}
export { Timing };
import prettyMilliseconds from "pretty-ms";
import styleText from "node-style-text";

const START_PREFIX = styleText.bgGray("[START]");
const END_PREFIX = styleText.bgGreen("[ END ]");

class Timing {
#message;
#startMark: PerformanceMark | undefined;

constructor(message: string) {
this.#message = message;
this.#startMark = performance.mark("start");
console.log(`${START_PREFIX}: ${message}`);
}

end(message?: string) {
const { duration } = performance.measure(this.#message, this.#startMark);
console.log(
(message ?? `${END_PREFIX}: ${this.#message}`) +
` (${styleText.blue.underline(prettyMilliseconds(duration))})`,
);
}
}

export { Timing };
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,13 @@ __metadata:
languageName: node
linkType: hard

"@eslint/js@npm:9.39.2":
version: 9.39.2
resolution: "@eslint/js@npm:9.39.2"
checksum: 10c0/00f51c52b04ac79faebfaa65a9652b2093b9c924e945479f1f3945473f78aee83cbc76c8d70bbffbf06f7024626575b16d97b66eab16182e1d0d39daff2f26f5
languageName: node
linkType: hard

"@eslint/object-schema@npm:^2.1.7":
version: 2.1.7
resolution: "@eslint/object-schema@npm:2.1.7"
Expand Down Expand Up @@ -3496,7 +3503,7 @@ __metadata:
"@actions/artifact": "npm:4.0.0"
"@actions/core": "npm:2.0.1"
"@actions/github": "npm:6.0.1"
"@eslint/js": "npm:9.39.1"
"@eslint/js": "npm:9.39.2"
"@types/node": "npm:25.0.0"
"@typescript-eslint/eslint-plugin": "npm:8.49.0"
"@typescript-eslint/parser": "npm:8.49.0"
Expand Down
Loading