Skip to content

Conversation

ospencer
Copy link
Member

@phated and I found that clock_time_get on Windows would return Bad file descriptor when asking for the thread time on Windows, i.e. uvwasi_clock_time_get for UVWASI_CLOCK_THREAD_CPUTIME_ID.

I saw it was just because GetProcessTimes was being called for both processes and threads, but threads specifically need GetThreadTimes.

I added some basic smoke tests (just ensuring the calls don't fail and that the returned times are non-zero), and tested this on a Windows machine and it appears to work.

Let me know if anything else is needed to get this landed 🙂

Copy link
Collaborator

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@cjihrig cjihrig merged commit 334b186 into nodejs:main Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants