@creejs/commons-lang 2.1.25 → 2.1.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creejs/commons-lang",
3
- "version": "2.1.25",
3
+ "version": "2.1.26",
4
4
  "description": "Commons Utils About Language, used inside creejs",
5
5
  "keywords": [
6
6
  "commons",
@@ -120,6 +120,9 @@ export function parallelAllSettled(tasks: Function[], maxParallel?: number): Pro
120
120
  * 2. Maybe multiple tasks are executed as a bulk block, and all of them resolved.
121
121
  * * only the first fulfilled value is returned
122
122
  * * other results are dropped
123
+ * 3. Notice:
124
+ * * In Beginning, we start bulk(maxParallel) of tasks
125
+ * * One task failed, it will start next task immediately, Not Wait for the bulk(maxParallel) to complete
123
126
  * @param {Array<Function|Promise<any>>} tasks - Array of async functions to execute
124
127
  * @param {number} [maxParallel=5] - Maximum number of tasks to run in parallel
125
128
  * @returns {Promise<any>} Resolves with the result of the first successfully completed task
@@ -1,6 +1,7 @@
1
1
  declare namespace _default {
2
2
  export { s2ns };
3
3
  export { ms2ns };
4
+ export { timestamp };
4
5
  export { timestamp64 };
5
6
  export { lapseNano };
6
7
  export { lapseMillis };
@@ -11,8 +12,16 @@ export default _default;
11
12
  export const s2ns: 1000000000;
12
13
  export const ms2ns: 1000000;
13
14
  /**
14
- * Gets the current timestamp in nanoseconds (if running in Node.js) or milliseconds (in browser).
15
- * Uses `process.hrtime.bigint()` for high-resolution timestamps in Node.js, falls back to `Date.now()` in browsers.
15
+ * Gets the current timestamp in milliseconds
16
+ * * If "performance" API is available, uses performance timeOrigin + now(), then convert to milliseconds
17
+ * * Else fall back to `Date.now()`
18
+ * @returns {number} Current timestamp in milliseconds
19
+ */
20
+ export function timestamp(): number;
21
+ /**
22
+ * Gets the current timestamp in nanoseconds
23
+ * * If "performance" API is available, uses performance timeOrigin + now()
24
+ * * Else fall back to `Date.now()` to get milliseconds and convert to nanoseconds
16
25
  * @returns {bigint} Current timestamp as a BigInt
17
26
  */
18
27
  export function timestamp64(): bigint;