Files
bun.sh/test/js/node/process/process-threadCpuUsage.test.ts
Claude Bot c5f9d2f758 Add process.threadCpuUsage() implementation
Implements process.threadCpuUsage() to return the current thread's CPU usage, matching Node.js behavior.

Platform-specific implementations:
- macOS: Uses mach_thread_self() and thread_info()
- Linux: Uses getrusage(RUSAGE_THREAD) or getrusage(RUSAGE_LWP) as fallback
- Windows: Uses libuv's uv_getrusage_thread()

Returns an object with user and system CPU time in microseconds, and supports an optional previous value parameter to calculate the difference.

Fixes issue #23890

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 06:16:35 +00:00

2.4 KiB