[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gettimeofday() and clock



Mads Bondo Dydensborg:
> Let me start by saying that it is late, and your program confuses me a
> lot. start does not seem to be initialised. You have a modulo and two
> divisions where a single division - perhaps two - ougth to be enough. It
> is like it the program is trying to do two things at once.
[cut]
Yes, it is not.
I did a great mess with my test files, it was somewhat working and i didn't 
check it propely.
I'm sorry.

Steve Baker:
>It's not the *only* way - but it's probably the best/most-portable.
That's good!

>Eh?  usec is short for MICROSECOND (a millionth of a second).
Ooops... for somewhat reasons i belived they were 1000... (what a shame...)

>No - the value it returns is always in microseconds - but the resolution
>might depend on the CPU.  On modern CPU's, you really do see it change in
>millionth of a second steps - but on some (like DEC Alpha's) would only
>increase the number in steps of 1000 or so.  However, the result was still
>in microseconds - it just jumped in value instead of changing smoothly.

>Use gettimeofday - it's working just fine - you must have some other problem.
In fact i confused the sleep() error (about 10000 usecs) with the effective 
MILLIsecs passed, without wrap (it was very strange...)

Ok, i'll promise i'll never make such posts again...
Thanx for your time (and your patience!)
Francesco