clock_t start0, finish0;
double duration0;
start0 = clock();
  finish0 = clock();
duration0 = (double)(finish0-start0)/CLOCKS_PER_SEC;