@soundworks/core 4.0.0-alpha.27 → 4.0.0-alpha.28
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
CHANGED
package/package.json
CHANGED
package/src/common/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// [WARNING] This file is generated, do not edit
|
|
2
|
-
export default '4.0.0-alpha.
|
|
2
|
+
export default '4.0.0-alpha.28';
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// Should move back to regular esm module once Max has fixed its loader
|
|
5
5
|
export default `
|
|
6
6
|
const { parentPort } = require('node:worker_threads');
|
|
7
|
+
const { hrtime } = require('node:process');
|
|
7
8
|
|
|
8
9
|
let stack = [];
|
|
9
10
|
let averageLatencyWindow = 5;
|
|
@@ -13,12 +14,14 @@ let intervalId = null;
|
|
|
13
14
|
let meanLatency = 0;
|
|
14
15
|
|
|
15
16
|
// workaround that sc-utils is pure emascript module
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
// 2024/09/06 - Just copy getTime implementation so that we don't even need the node_modules
|
|
18
|
+
const start = hrtime.bigint();
|
|
19
|
+
|
|
20
|
+
function getTime() {
|
|
21
|
+
const now = hrtime.bigint();
|
|
22
|
+
const delta = now - start;
|
|
23
|
+
return Number(delta) * 1e-9;
|
|
24
|
+
}
|
|
22
25
|
|
|
23
26
|
parentPort.on('message', async msg => {
|
|
24
27
|
switch (msg.type) {
|
|
@@ -26,7 +29,6 @@ parentPort.on('message', async msg => {
|
|
|
26
29
|
averageLatencyWindow = msg.value.averageLatencyWindow;
|
|
27
30
|
averageLatencyPeriod = msg.value.averageLatencyPeriod;
|
|
28
31
|
|
|
29
|
-
await inited;
|
|
30
32
|
// launch compute in its own loop so that the number of computation is
|
|
31
33
|
// decoupled from the number of connected clients
|
|
32
34
|
clearInterval(intervalId);
|