@thi.ng/bench 3.2.2 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/now.d.ts +2 -2
- package/now.js +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-02-
|
|
3
|
+
- **Last updated**: 2023-02-17T20:06:13Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,13 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [3.2.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@3.2.3) (2023-02-17)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update timeDiff() ([37054e0](https://github.com/thi-ng/umbrella/commit/37054e0))
|
|
17
|
+
- default 2nd arg to current timestamp
|
|
18
|
+
|
|
12
19
|
## [3.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/bench@3.2.0) (2023-02-05)
|
|
13
20
|
|
|
14
21
|
#### 🚀 Features
|
package/now.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ import type { Timestamp } from "./api.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const now: Fn0<Timestamp>;
|
|
9
9
|
/**
|
|
10
|
-
* Returns the difference in milliseconds between 2 given
|
|
11
|
-
* {@link
|
|
10
|
+
* Returns the difference in milliseconds between 2 given {@link Timestamp}s.
|
|
11
|
+
* `b` defaults to result of {@link now}.
|
|
12
12
|
*
|
|
13
13
|
* @param a
|
|
14
14
|
* @param b
|
package/now.js
CHANGED
|
@@ -15,12 +15,12 @@ export const now = typeof BigInt !== "undefined"
|
|
|
15
15
|
? () => performance.now() * 1e6
|
|
16
16
|
: () => Date.now() * 1e6;
|
|
17
17
|
/**
|
|
18
|
-
* Returns the difference in milliseconds between 2 given
|
|
19
|
-
* {@link
|
|
18
|
+
* Returns the difference in milliseconds between 2 given {@link Timestamp}s.
|
|
19
|
+
* `b` defaults to result of {@link now}.
|
|
20
20
|
*
|
|
21
21
|
* @param a
|
|
22
22
|
* @param b
|
|
23
23
|
*/
|
|
24
|
-
export const timeDiff = (a, b) => (typeof BigInt !== "undefined"
|
|
24
|
+
export const timeDiff = (a, b = now()) => (typeof BigInt !== "undefined"
|
|
25
25
|
? Number(b - a)
|
|
26
26
|
: b - a) * 1e-6;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/bench",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Benchmarking utilities w/ various statistics & formatters (CSV, Markdown etc.)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
],
|
|
115
115
|
"year": 2018
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "7896250248d960109253215c75b115c46626293e\n"
|
|
118
118
|
}
|