qa: improve newlib/040-gettimeofday.c
This commit is contained in:
parent
59e881c04d
commit
9bdbd9b09d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue