I'm still a newbie, but you could write a port/BIF in C which calls into the Windows high-resolution timers. You'll lose a tiny bit but I'd think you'll get better than 1ms resolutions.<div><div><br></div>
<div>-mox<br><br><div class="gmail_quote">On Tue, May 24, 2011 at 2:32 AM, Amy Lear <span dir="ltr"><<a href="mailto:octopusfluff@gmail.com">octopusfluff@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Tue, May 24, 2011 at 2:02 AM, Magnus Henoch <span dir="ltr"><<a href="mailto:magnus.henoch@erlang-solutions.com" target="_blank">magnus.henoch@erlang-solutions.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div>----- "Amy Lear" <<a href="mailto:octopusfluff@gmail.com" target="_blank">octopusfluff@gmail.com</a>> wrote:<br>
<br>
> The issue here as I understand it is that the system clock itself<br>
> can't report things in the microsecond range (msdn states the<br>
> granularity is between 10ms and 15ms:<br>
> <a href="http://msdn.microsoft.com/en-us/library/system.datetimeoffset.utcnow.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/system.datetimeoffset.utcnow.aspx</a><br>
> ), but the real values are being mangled to provide those guaranteed<br>
> unique values. Given that now/0 is the obvious means of doing<br>
> measurement for an erlang user -- and in fact the instrumentation<br>
> tools that ship with erlang also appear to rely on it -- this results<br>
> in puzzling and undesired behavior.<br>
<br>
</div>Have you tried os:timestamp/0? It's like now/0 but without the<br>
uniqueness guarantee. I'm not sure what granularity it has on<br>
Windows, though.<br>
<br>
Hope this helps,<br></blockquote></div><div><br>Unfortunately, it appears that the granularity of os:timestamp/0 is no finer than 1 ms, and the minimum resolution appears to be machine-dependant. Msdn research also suggests that the 1ms resolution timer is slower to access than the normal system clock, which could matter in some circumstances. Conversely, dropping the uniqueness facet and being higher resolution than now/0 does have some potential usefulness, but the erlang documentation indicates that the provided profiling tools rely on now/0.<br>
<br>My question about instrumentation stands: is there currently a way to do high resolution profiling in Erlang on Windows? Is the requisite work of setting up sub-ms resolution timers simply not done/too much work to attempt?<br>
</div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div></div>