* Closes profiler and releases resources. Idempotent, safe for exit handlers. * **Exit Handler Usage**: Call only this method from process exit handlers.
()
| 273 | * **Exit Handler Usage**: Call only this method from process exit handlers. |
| 274 | */ |
| 275 | close(): void { |
| 276 | if (this.#state === 'closed') { |
| 277 | return; |
| 278 | } |
| 279 | this.#unsubscribeExitHandlers?.(); |
| 280 | this.#transition('closed'); |
| 281 | } |
| 282 | |
| 283 | /** @returns Current profiler state */ |
| 284 | get state(): 'idle' | 'running' | 'closed' { |
no test coverage detected