diff --git a/tests/bandwidth-master.c b/tests/bandwidth-master.c index 0227b6c..1f455ef 100644 --- a/tests/bandwidth-master.c +++ b/tests/bandwidth-master.c @@ -26,15 +26,16 @@ /* Tests based on PI-MBUS-300 documentation */ #define SLAVE 0x11 -#define NB_LOOPS 10000 +#define NB_LOOPS 100000 -#define G_USEC_PER_SEC 1000000 -uint32_t gettime(void) +#define G_MSEC_PER_SEC 1000 + +uint32_t gettime_ms(void) { struct timeval tv; gettimeofday (&tv, NULL); - return (uint32_t) tv.tv_sec * G_USEC_PER_SEC + tv.tv_usec; + return (uint32_t) tv.tv_sec * 1000 + tv.tv_usec / 1000; } int main(void) @@ -69,20 +70,20 @@ int main(void) printf("READ COIL STATUS\n\n"); nb_points = MAX_STATUS; - start = gettime(); + start = gettime_ms(); for (i=0; i