lkml.org 
[lkml]   [2003]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRE: timing an application
>>>>> On Tue, 14 Jan 2003 12:37:05 -0800, "Howell, David P" <david.p.howell@intel.com> said:

Dave> If this is on a IA32(Pentium II or later)/IA64 have you
Dave> considered using the processor TSC register to get interval
Dave> timestamps? It's a lot lighter weight and should give better
Dave> resolution. When we have done this we compared the tick values
Dave> directly.

Dave> To convert TSC ticks to time the /proc/cpuinfo value for 'cpu
Dave> MHz', see the glibc get_clockfreq.c and hp_timing.h
Dave> implementation for details.

Note that it's tricky to uses TSC/ITC on multiprocessors, especially
on large machines, on which the clocks for different CPUs may drift, etc.
It's much better to use the clock_gettime() routine:

http://www.opengroup.org/onlinepubs/007908799/xsh/clock_getres.html

Where properly implemented, this will be both as fast and accurate.

--david
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.030 / U:3.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site