time functions help?

Hello to anyone who can help me!

I am in need of some help in procuring a more exact timing scheme in C for use with gcc.

I manage to get a timing in seconds just fine using difftime(). However, I need more accurate.. milliseconds... no clue.

Please help?

Brian

Hi!

If you are planning to get the time in milliseconds after the last second, use gettimeofday\(struct timeval *tp, void *tzp\), after who's call, the tp.tv_usec  should return you the microseconds.

Rgds
SHAIK

You can also use gethrtime() in section 3C if you want nanoseconds.