afterEach(fn)


  • fn <Function> | <AsyncFunction> 这个钩子函数。它接收一个包含基准测试的 name、params 和 signal 的对象。

注册一个钩子,在当前套件中的每个完整的逻辑基准测试之后运行一次。它不会在每个样本之后运行。每个样本的清理应该在基准函数里在 context.end() 或 context.record() 之后进行。

🌐 Registers a hook that runs once after each complete logical benchmark in the current suite. It does not run after every sample. Per-sample cleanup belongs in the benchmark function after context.end() or context.record().