<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=447200914-15062009><FONT face=Arial color=#0000ff size=2>one
needs to convert to double ...</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Tzachi Dar <BR><B>Sent:</B> Monday, June
15, 2009 4:52 PM<BR><B>To:</B> ofw@lists.openfabrics.org<BR><B>Cc:</B> Windows
Design<BR><B>Subject:</B> A problem on cl_get_time_stamp (and other
functions)<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009>When running on a
new system I have came to conclusion that there is a problem with
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=134273913-15062009>uint64_t<BR>cl_get_time_stamp( void
)<BR>{<BR> LARGE_INTEGER tick_count, frequency;</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009> if(
!QueryPerformanceFrequency( &frequency ) )<BR> return( 0
);</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009> if(
!QueryPerformanceCounter( &tick_count ) )<BR> return( 0
);</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009> return(
tick_count.QuadPart / (frequency.QuadPart / SEC_TO_MICRO)
);<BR>}</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=134273913-15062009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009>The problem starts
from the fact that frequency is 3579545. In other words, this means that
(frequency.QuadPart / SEC_TO_MICRO) is 3 and not 3.579 and all measurements
are bypassed with 19%.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=134273913-15062009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009>I suggest to
change that to be </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=134273913-15062009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009>return(
SEC_TO_MICRO * tick_count.QuadPart / frequency.QuadPart )
);</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=134273913-15062009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009>We probably have
to look at all other places...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=134273913-15062009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009>Please also note
that on another computer, I have received "frequency =
14318180".</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009>This is much
better than before, but please note that we were still wrong in around
3%.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=134273913-15062009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009>On a different
computer I have also received 1121205359 which is probably
fine.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=134273913-15062009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=134273913-15062009>Thanks</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=134273913-15062009>Tzachi</DIV>
<DIV><BR></DIV></BLOCKQUOTE></SPAN></FONT></BODY></HTML>