tinybench icon indicating copy to clipboard operation
tinybench copied to clipboard

reorder teardown callback to after the error event, and setResults.

Open jdmarshall opened this issue 2 years ago • 0 comments

fix for #61

Change order of operations to

  • emit error event if it exists
  • calculate results
  • call teardown hook
  • emit cycle event

I'm not sure why you would ever call teardown before dealing with an error that was part of the test run.

Putting teardown after setResults allows a person to purge the samples to avoid memory starvation in longer test runs.

jdmarshall avatar Nov 04 '23 21:11 jdmarshall