[zeromq-dev] libzapi: @discuss zclock
Pieter Hintjens
ph at imatix.com
Fri Apr 8 15:43:39 CEST 2011
On Fri, Apr 8, 2011 at 3:31 PM, Steven McCoy <steven.mccoy at miru.hk> wrote:
Thanks for the code review!
> I think you've been beguiled by the Windows API, unsurprisingly in reality
> it is pretty terrible.
:) of course.
> If you call Sleep() with zero milliseconds you end
> up with a yield on older versions of Windows. Also, you are going to get
> only 16ms resolution and you must use timeBeginPeriod() to actually get to
> 1ms.
Send me a patch?
> On Unix as well as nanosleep() you have access to usleep() for microseconds.
> http://pubs.opengroup.org/onlinepubs/007908799/xsh/usleep.html
usleep is deprecated and removed from POSIX.2008.
> This doesn't do what you think it does, use GetSystemTimeAsFileTime()
> instead.
Hmm, I vaguely remember this from a previous life. Send me a patch?
I've no Win32 box booted right now.
> I'm surprised you don't have a zclock_delay() API, but I guess depends on
> demand.
What would this do? zclock_sleep() already exists.
-Pieter
More information about the zeromq-dev
mailing list