On Sat, 11 Jul 1998, Henrik Nordstrom wrote:
> Mohd Khalid Kasmin wrote:
>
> > the first two will work, while the second pair won't.
>
> I am suprised any of them did work. t1 & z1 are uninitialized pointers
> that may point to any memory location.
>
> Always use -Wall when compiling programs, it traps most simple errors.
>
> The code should read
>
> struct timeval t1,t2;
>
> gettimeofday(&t1,NULL);
> ...
> gettimeofday(&t2,NULL);
>
> (you don't need to get tz unless you want it...)
>
> ---
> Henrik Nordström
>
Thank you all for helping me in this matter. My understanding of
* and & operator still very confused. I hope I'll get the hang of
it soon.
The -O option now works and I see that my P166 can compute the
tan() loop 23x faster.
I've always wonder why samples programs submitted to this list
always use the #include <stdio.h> while I have no problem
compiling a program without it when all I use is just printf.
the -Wall switch tells me why, thanks Henrik.
Thank you also to Brock for telling me about the Real Time Clock,
I have been wondering about it for quite sometime, as to how can I
access it from C in Linux since I'll need it in my analog to
digital signal processing works. (I am a QuickBASIC veteran and
accessing RTC from qb is somewhat easier - well because I can
access almost any hardware ports from it) But todays pc are so
powerful, it is a waste of computer resource to just let qb and
my assmbly routines live in it. But before I can fully convert
to using Linux, I need to understand more about C and writting
device drivers since all my ADDA cards doesn't come with a Linux
driver. A pointer to technical examples on this topics is most
welcome.
Regards
Khalid