Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit c64ddad

Browse files
committed
Auto-set samples, add setMaxRunTime
1 parent 748728e commit c64ddad

11 files changed

Lines changed: 148 additions & 68 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ on:
44
types: [created]
55
jobs:
66
release-js:
7-
name: 'jsbt v0.3.3' # Should match commit below
8-
uses: paulmillr/jsbt/.github/workflows/release.yml@c9a9f2cd6b4841aa3117b174e9ea468b1650e5ea
7+
name: 'jsbt v0.4.1'
8+
uses: paulmillr/jsbt/.github/workflows/release.yml@2318b9efe24831b4bd4cadf720c96f071c69c64d
9+
with:
10+
build-path: test/build
11+
# slow-types: false
912
secrets:
1013
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1114
permissions:

.github/workflows/test-js.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
name: Run tests
1+
name: Run JS tests
22
on:
33
- push
44
- pull_request
55
jobs:
66
test-js:
7-
name: 'jsbt v0.3.3' # Should match commit below
8-
uses: paulmillr/jsbt/.github/workflows/test-js.yml@c9a9f2cd6b4841aa3117b174e9ea468b1650e5ea
7+
name: 'jsbt v0.4.1'
8+
uses: paulmillr/jsbt/.github/workflows/test-js.yml@2318b9efe24831b4bd4cadf720c96f071c69c64d
9+
# with:
10+
# submodules: false

compare.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
declare function compare(title: string, dimensions: any, libs: any, opts: any): void;
22
export default compare;
33
export { compare };
4+
//# sourceMappingURL=compare.d.ts.map

compare.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare function getTime(): bigint;
1+
declare function setMaxRunTime(val: number): void;
22
declare function logMem(): void;
33
declare function formatDuration(duration: any): string;
44
declare function calcDeviation<T extends number | bigint>(list: T[]): number;
@@ -25,17 +25,20 @@ export type BenchStats = {
2525
perItemStr: string;
2626
measurements: bigint[];
2727
};
28-
declare function benchmarkRaw(samples: number, callback: Func): Promise<BenchStats>;
28+
declare function getTime(): bigint;
29+
declare function benchmarkRaw(samples: number | undefined, callback: Func): Promise<BenchStats>;
2930
export type Func = (iteration?: number) => {};
3031
export declare function mark(label: string, samples: number, callback: Func): Promise<undefined>;
3132
export declare function mark(label: string, callback: Func): Promise<undefined>;
3233
export default mark;
3334
export declare const utils: {
3435
getTime: typeof getTime;
36+
setMaxRunTime: typeof setMaxRunTime;
3537
logMem: typeof logMem;
3638
formatDuration: typeof formatDuration;
3739
calcStats: typeof calcStats;
3840
calcDeviation: typeof calcDeviation;
3941
calcCorrelation: typeof calcCorrelation;
4042
benchmarkRaw: typeof benchmarkRaw;
4143
};
44+
//# sourceMappingURL=index.d.ts.map

index.js

Lines changed: 42 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 35 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "micro-bmark",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "Benchmark your JS projects with nanosecond resolution",
55
"main": "index.js",
66
"type": "module",
@@ -36,7 +36,9 @@
3636
},
3737
"license": "MIT",
3838
"devDependencies": {
39-
"@paulmillr/jsbt": "0.3.3",
39+
"@paulmillr/jsbt": "0.4.1",
40+
"micro-bmark": "0.4.1",
41+
"micro-should": "0.5.3",
4042
"prettier": "3.5.3",
4143
"typescript": "5.8.3"
4244
}

0 commit comments

Comments
 (0)