Skip to content
Discussion options

You must be logged in to vote

you can now create manual benchmarks (v1.0.34 and newer)

(note: concurrency is not available in manual benchmarks)

lineplot(() => {
  bench('test', function* () {
    yield {
      heap: false,
      counters: false,

      budget: 'real',
      // or
      budget: 'manual',

      // budget determines how long the benchmark is run
      // manual time budget will only count duration you provide
      // real (default) time budget will take into account duration of whole manual() call

      [0]() {
        return 5000 * 1e6; // 5s in nanoseconds
      },

      // manual() has to return nanoseconds duration
      async manual(p0) {
        return p0;
      },
    };
  });
});

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@agoldstein03
Comment options

Answer selected by evanwashere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants