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 @@ -31,7 +31,7 @@
"@types/node": "25.0.0",
"@typescript-eslint/eslint-plugin": "8.49.0",
"@typescript-eslint/parser": "8.49.0",
"eslint": "9.39.1",
"eslint": "9.39.2",
"eslint-config-prettier": "10.1.8",
"globals": "16.5.0",
"npm-run-all": "4.1.5",
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 };
19 changes: 13 additions & 6 deletions 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 @@ -2161,17 +2168,17 @@ __metadata:
languageName: node
linkType: hard

"eslint@npm:9.39.1":
version: 9.39.1
resolution: "eslint@npm:9.39.1"
"eslint@npm:9.39.2":
version: 9.39.2
resolution: "eslint@npm:9.39.2"
dependencies:
"@eslint-community/eslint-utils": "npm:^4.8.0"
"@eslint-community/regexpp": "npm:^4.12.1"
"@eslint/config-array": "npm:^0.21.1"
"@eslint/config-helpers": "npm:^0.4.2"
"@eslint/core": "npm:^0.17.0"
"@eslint/eslintrc": "npm:^3.3.1"
"@eslint/js": "npm:9.39.1"
"@eslint/js": "npm:9.39.2"
"@eslint/plugin-kit": "npm:^0.4.1"
"@humanfs/node": "npm:^0.16.6"
"@humanwhocodes/module-importer": "npm:^1.0.1"
Expand Down Expand Up @@ -2206,7 +2213,7 @@ __metadata:
optional: true
bin:
eslint: bin/eslint.js
checksum: 10c0/59b2480639404ba24578ca480f973683b87b7aac8aa7e349240474a39067804fd13cd8b9cb22fee074170b8c7c563b57bab703ec0f0d3f81ea017e5d2cad299d
checksum: 10c0/bb88ca8fd16bb7e1ac3e13804c54d41c583214460c0faa7b3e7c574e69c5600c7122295500fb4b0c06067831111db740931e98da1340329527658e1cf80073d3
languageName: node
linkType: hard

Expand Down Expand Up @@ -3500,7 +3507,7 @@ __metadata:
"@types/node": "npm:25.0.0"
"@typescript-eslint/eslint-plugin": "npm:8.49.0"
"@typescript-eslint/parser": "npm:8.49.0"
eslint: "npm:9.39.1"
eslint: "npm:9.39.2"
eslint-config-prettier: "npm:10.1.8"
globals: "npm:16.5.0"
nano-spawn: "npm:2.0.0"
Expand Down
Loading