mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
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>
2.4 KiB
2.4 KiB