int main() {
    input();
    timer_begin();
    sort_index();
    dfs(0, 0);
    timer_end();
    fprintf(stderr, "n = %d, dfs_cnt = %d, duration = %f\n", n, dfs_cnt, timer_duration());
    output();
    return 0;
}
Beispiel #2
0
static void bench(char const *filename, int reqcomp)
{
   static const int kRuns = 30;

   timer_init();
   long long tstart = timer_sample();

   for (int run = 0; run < kRuns; ++run) {
      int x, y, n;
      unsigned char *data = stbi_load(filename, &x, &y, &n, reqcomp);
      stbi_image_free(data);
   }

   double dur_ms = timer_duration(timer_sample() - tstart) * 1000.0;
   printf("%d runs in %.3f ms -> %.3f ms/run\n", kRuns, dur_ms, dur_ms / kRuns);
}