Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
334 B
3
Indexable
Never
#include <stdio.h>
#include <sys/time.h>

void main() {

	struct timeval stop, start, test;

	gettimeofday(&start, NULL);

	int i = 0;
	for (i = 0; i < 100000; i++)
	{
		gettimeofday(&test, NULL);
	}

	gettimeofday(&stop, NULL);
	printf("stop.tv_sec %lu us\n", (stop.tv_sec - start.tv_sec) * 1000000 + stop.tv_usec - start.tv_usec);
}