Untitled

 avatar
unknown
plain_text
4 years ago
334 B
6
Indexable
#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);
}
Editor is loading...