#include #include #include int main() { libgretl_init(); PRN *prn = gretl_print_new(GRETL_PRINT_STDOUT, NULL); int err, i, j, observations; const int executions = 10000; const int nsets = 7; const int startObs = 197; long int times[nsets]; DATASET *sets[nsets]; int *par = gretl_list_new(1); par[1] = 1; for(j = 0; j < nsets; ++j) { observations = j + startObs; sets[j] = create_new_dataset(2, observations, 0); for(i = 0; i < observations; ++i) sets[j]->Z[1][i] = i; } for(j = 0; j < nsets; ++j) { struct timeval tim; gettimeofday(&tim, NULL); long int t1 = (tim.tv_sec * 1000000) + tim.tv_usec; for(i = 0; i < executions; ++i) get_mahal_distances(par, sets[j], OPT_NONE, 0, &err); struct timeval tim2; gettimeofday(&tim2, NULL); long int t2 = (tim2.tv_sec * 1000000) + tim2.tv_usec; times[j] = t2 - t1; } for(j = 0; j < nsets; ++j) printf("%i number of observations: %ld\n", j + startObs, times[j]); for(j = 0; j < nsets; ++j) destroy_dataset(sets[j]); gretl_print_destroy(prn); libgretl_cleanup(); return 0; }