On Wed, Jan 19, 2005 at 08:12:13PM -0600, Ryan Sommers wrote:
> Marco Trentini wrote:
> >Hi, I need to clock the function execution time into a C
> >program. I know /usr/include/time.h library but I need to
> >clock the time in milliseconds.
> >
> >Any suggestions, links?
> >
>
> Are you looking f
Remember to calibrate RDTSC against the RTC first if you're using it in
production. It's quite accurate but some mobile CPUs count in coarser
units than you'd predict from master clock rate.
--
Here's a simple experiment. Stand on a train track between two locomotives
which are pushing on you wit
Claudiu Dragalina-Paraipan wrote:
Or you can use PERFMON. Check manual page for perfmon.
It gives you access to internal counters of CPU.
Of course this is a subjective measurement, since, AFAIK, the counters
are not kept separately for every process, but for entire system,
including kernel.
Maybe
Erich Dollansky wrote:
Hi,
Alin-Adrian Anton wrote:
For this snippet (which deals with a B+tree) i got results of the form
0.3445866564 microseconds, which means 344.5867 miliseconds.. etc..
You mixed the units up
1 second is 1 000 ms which is 1 000 000 µs which is 1 000 000 000 ns.
Yes I noticed
Or you can use PERFMON. Check manual page for perfmon.
It gives you access to internal counters of CPU.
Of course this is a subjective measurement, since, AFAIK, the counters
are not kept separately for every process, but for entire system,
including kernel.
Maybe repeating the same measurement fo
> I don't think there is a streight way to speed-up the default
> unix time resolution, which is, as far as i know, in
> microseconds.
On i386 (and possibly amd64) platforms you can use the
RDTSC instruction to get a direct measure of processor
cycles elapsed.
--
FreeBSD Volunteer, http://peop
Hi,
Alin-Adrian Anton wrote:
For this snippet (which deals with a B+tree) i got results of the form
0.3445866564 microseconds, which means 344.5867 miliseconds.. etc..
You mixed the units up
1 second is 1 000 ms which is 1 000 000 µs which is 1 000 000 000 ns.
Erich
__
Marco Trentini wrote:
Hi, I need to clock the function execution time into a C
program. I know /usr/include/time.h library but I need to
clock the time in milliseconds.
Any suggestions, links?
---snip---
#include
struct timeval tv1,tv2;
struct timezone tz1,tz2;
gettimeofday(&tv1,&tz1);
for (i=0;i<
Marco Trentini wrote:
Hi, I need to clock the function execution time into a C
program. I know /usr/include/time.h library but I need to
clock the time in milliseconds.
Any suggestions, links?
Are you looking for how long the processor spent executing your code? Or
the difference in wall time betw
On Thu, 20 Jan 2005 11:14, Marco Trentini wrote:
> Hi, I need to clock the function execution time into a C
> program. I know /usr/include/time.h library but I need to
> clock the time in milliseconds.
How about..
struct timeval then, now;
gettimeofday(&then, NULL);
somefunction();
gettimeofday(&
In article <[EMAIL PROTECTED]> you write:
>
>Hi, I need to clock the function execution time into a C
>program. I know /usr/include/time.h library but I need to
>clock the time in milliseconds.
>
>Any suggestions, links?
% man clock_gettime
Is nanoseconds too much?
--
Steve Watt KD6GGD PP-ASEL
11 matches
Mail list logo