OK, thanks guys for valuable suggestions. Am I correct that the general suggestion is to use clock_gettime(CLOCK_REALTIME) instead of the gettimeofday(), and fix few types here and there? -Maxim