-
Notifications
You must be signed in to change notification settings - Fork 15
Try to somehow implement clock_res_get on Windows. #124
Conversation
Unforunately,
|
I caught up with latest master. |
I'll probably need to open an issue in WebAssembly/WASI about these issues with implementation. They may make us reconsider the API spec. |
I'm not counting that out. However, before we do that, perhaps we should consult @peterhuene first? @peterhuene would you have any thoughts on this PR and the discussion in general? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great and you did some really in-depth investigation into how this could be well-implemented on Windows. Thanks for that!
Just some general feedback and a requested clarification on what the resolution value for the realtime clock is representing.
Also update misc_testsuite to include latest clock_time_get test changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, thanks!
I don't like this implementation, and I'm not sure if we should merge it, but I think it's the best we can do without overly complicating stuff. We depend on the implementation details on
std::time::{SystemTime, Instant}
andcpu-time
(on the underlying Windows syscalls).While we could avoid it for
ProcessTime
andThreadTime
by adding an associated function returning the timer resolution, possibly the same forInstant
(and wait forever until it's stable), but the problems forSystemTime
are much more fundamental. We may have to reconsider this part of WASI API.Depends on #117 and the implementation details of #119.