Skip to content

Commit

Permalink
feat(bundle-source): Provide high resolution timer to read governor
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Jul 25, 2023
1 parent 159a161 commit 7021787
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/bundle-source/cache.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global performance */
// @ts-check
import { makePromiseKit } from '@endo/promise-kit';
import { makeReadPowers } from '@endo/compartment-mapper/node-powers.js';
Expand Down Expand Up @@ -350,7 +351,7 @@ export const makeNodeBundleCache = async (dest, options, loadModule) => {
]);

const readPowers = {
...makeReadPowers({ fs, url, crypto }),
...makeReadPowers({ fs, url, crypto, now: performance.now }),
delay: ms => new Promise(resolve => timers.setTimeout(resolve, ms)),
basename: path.basename,
};
Expand Down
4 changes: 2 additions & 2 deletions packages/bundle-source/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global process */
/* global process performance */

import fs from 'fs';
import { rollup as rollup0 } from 'rollup';
Expand Down Expand Up @@ -34,7 +34,7 @@ const HTML_COMMENT_END_RE = new RegExp(`--${'>'}`, 'g');

const textEncoder = new TextEncoder();
const textDecoder = new TextDecoder();
const readPowers = makeReadPowers({ fs, url, crypto });
const readPowers = makeReadPowers({ fs, url, crypto, now: performance.now });

/**
* Finds the longest common prefix in an array of strings.
Expand Down

0 comments on commit 7021787

Please sign in to comment.