qa: fix test newlib/040-gettimeofday.c
This commit is contained in:
parent
bd149a18f1
commit
44fa703f84
|
@ -7,15 +7,15 @@ int main (int argc, char** argv) {
|
||||||
|
|
||||||
gettimeofday (&tvalBefore, NULL);
|
gettimeofday (&tvalBefore, NULL);
|
||||||
int i =0;
|
int i =0;
|
||||||
while (i < 10000)
|
while (i < 100000000)
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
gettimeofday (&tvalAfter, NULL);
|
gettimeofday (&tvalAfter, NULL);
|
||||||
|
|
||||||
// Changed format to long int (%ld), changed time calculation
|
// Changed format to long int (%ld), changed time calculation
|
||||||
|
|
||||||
delta = ((tvalAfter.tv_sec - tvalBefore.tv_sec)*1000000L
|
delta = (tvalAfter.tv_sec - tvalBefore.tv_sec)*1000000L
|
||||||
+tvalAfter.tv_usec) - tvalBefore.tv_usec;
|
+(tvalAfter.tv_usec - tvalBefore.tv_usec);
|
||||||
printf("Time in microseconds: %ld microseconds\n", delta);
|
printf("Time in microseconds: %ld microseconds\n", delta);
|
||||||
|
|
||||||
if(delta > 0)
|
if(delta > 0)
|
||||||
|
|
Loading…
Reference in New Issue