Higher-resolution time for win32

Andy Grundman andy at hybridized.org
Thu Jul 2 03:39:19 CEST 2009


I noticed the libev time resolution on Win32 was only 1ms.  Microsoft  
is of course too horrible to fix this properly, so nasty hacks have  
been developed.  I ported the one used by Time::HiRes and it appears  
to work fine.  I don't expect this patch is good enough, but want to  
at least start some discussion on the topic.

Two problems with this patch:

Not thread-safe.  Time::HiRes uses Perl context to handle this, but I  
wasn't sure of the best way to do it in libev.
The fact that time can move backwards is a bit worrying.  Although  
Time::HiRes gets away with it!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: win32_hires_time.patch
Type: application/octet-stream
Size: 3619 bytes
Desc: not available
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20090701/e86dfab5/attachment.obj>
-------------- next part --------------



-Andy


More information about the libev mailing list