static struct ssa_db *load_smdb(const char *path) { struct ssa_db *db_diff = NULL; clock_t start, end; double cpu_time_used; print_memory_usage("Memory usage before the database loading: "); start = clock(); db_diff = ssa_db_load(path,SSA_DB_HELPER_DEBUG); end = clock(); cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC; if(NULL != db_diff) { printf("A database is loaded successfully.\n"); printf("Loading cpu time: %.5f sec.\n",cpu_time_used); print_memory_usage("Memory usage after the database loading: "); } else { fprintf(stderr,"Database loading is failed.\n"); } return db_diff; }
static void print_benchmark(void) { double tt, pfreq; end_ticks = tsc(); times(&e); pfreq = proc_frequency(); tt = ll_to_double(end_ticks - start_ticks) / pfreq; fprintf(stderr, "runtime: %.3f\n", tt); fprintf(stderr, "cputime: %.2f\n", (e.tms_utime - s.tms_utime) / 100.0); print_memory_usage(); }