@cellaware/utils 7.2.0 → 7.2.2
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/dist/stopwatch.d.ts +8 -0
- package/dist/stopwatch.js +36 -0
- package/package.json +4 -4
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export class Stopwatch {
|
|
2
|
+
constructor() {
|
|
3
|
+
Object.defineProperty(this, "startTime", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
configurable: true,
|
|
6
|
+
writable: true,
|
|
7
|
+
value: void 0
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(this, "elapsed", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: 0n
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
start() {
|
|
17
|
+
if (!this.startTime) {
|
|
18
|
+
this.startTime = process.hrtime.bigint();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
stop() {
|
|
22
|
+
if (!!this.startTime) {
|
|
23
|
+
this.elapsed += process.hrtime.bigint() - this.startTime;
|
|
24
|
+
this.startTime = undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
reset() {
|
|
28
|
+
this.elapsed = 0n;
|
|
29
|
+
this.startTime = undefined;
|
|
30
|
+
}
|
|
31
|
+
getElapsedMs() {
|
|
32
|
+
const now = this.startTime ? process.hrtime.bigint() : 0n;
|
|
33
|
+
const total = this.elapsed + (this.startTime ? now - this.startTime : 0n);
|
|
34
|
+
return Number(total) / 1e6;
|
|
35
|
+
}
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cellaware/utils",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.2",
|
|
4
4
|
"description": "Cellaware Utilities for Node.js",
|
|
5
5
|
"author": "Cellaware Technologies",
|
|
6
6
|
"type": "module",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"homepage": "https://cellaware.com",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@azure/communication-email": "^1.0.0",
|
|
20
|
-
"@azure/cosmos": "^
|
|
21
|
-
"@azure/functions": "^4.
|
|
22
|
-
"@azure/storage-blob": "^12.
|
|
20
|
+
"@azure/cosmos": "^3.17.0",
|
|
21
|
+
"@azure/functions": "^4.5.1",
|
|
22
|
+
"@azure/storage-blob": "^12.16.0",
|
|
23
23
|
"dotenv": "^16.3.1",
|
|
24
24
|
"langchain": "^0.2.19"
|
|
25
25
|
},
|