qa: improve newlib/040-gettimeofday.c

This commit is contained in:
Giacomo Tesio 2017-08-28 02:47:05 +02:00
parent 59e881c04d
commit 9bdbd9b09d
1 changed files with 2 additions and 4 deletions

View File

@ -1,15 +1,13 @@
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
int main (int argc, char** argv) {
struct timeval tvalBefore, tvalAfter;
long delta;
gettimeofday (&tvalBefore, NULL);
int i =0;
while (i < 100000000)
i++;
sleep(2);
gettimeofday (&tvalAfter, NULL);
// Changed format to long int (%ld), changed time calculation