mongodb 7.0.0-dev.20251203.sha.a96fa26d → 7.0.0-dev.20251204.sha.ae2e037e

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/src/utils.ts CHANGED
@@ -434,10 +434,13 @@ export function makeStateMachine(stateTable: StateTable): StateTransitionFunctio
434
434
  };
435
435
  }
436
436
 
437
- /** @internal */
438
- export function now(): number {
439
- const hrtime = process.hrtime();
440
- return Math.floor(hrtime[0] * 1000 + hrtime[1] / 1000000);
437
+ /**
438
+ * This function returns the number of milliseconds since an arbitrary point in time.
439
+ * This function should only be used to measure time intervals.
440
+ * @internal
441
+ * */
442
+ export function processTimeMS(): number {
443
+ return Math.floor(performance.now());
441
444
  }
442
445
 
443
446
  /** @internal */
@@ -446,7 +449,7 @@ export function calculateDurationInMs(started: number | undefined): number {
446
449
  return -1;
447
450
  }
448
451
 
449
- const elapsed = now() - started;
452
+ const elapsed = processTimeMS() - started;
450
453
  return elapsed < 0 ? 0 : elapsed;
451
454
  }
452
455