#include #include #include #include "rkdtree.h" #include "rkdnode.h" int main() { unsigned int i; rkdtree_t *T = rkdtree_init(2); FILE *f = fopen("insert_time.data", "w"); int key[2]; for(i=0;i<10000;i++) { printf("Insert #%d\n", i); key[0] = random() % 200; key[1] = random() % 200; struct timeval before, after; gettimeofday(&before, NULL); rkdtree_insert(T, key, NULL); gettimeofday(&after, NULL); printf("Took %u\n", after.tv_usec - before.tv_usec); fprintf(f, "%u %u\n", i, after.tv_usec - before.tv_usec); } printf("Node # : %d\n", T->root->elem_count); rkdtree_dump(T); fclose(f); return EXIT_SUCCESS; }