time.c

来自「排序算法的实现」· C语言 代码 · 共 54 行

C
54
字号
#include<stdlib.h>
#include<stdio.h>





float timeclock(void  (*fun)(),float *p,long m)
{ clock_t start,end;
  float during; 
  start=clock();
  (*(fun))(p,m);
  end=clock();
  during=(float)(end-start)/CLOCKS_PER_SEC;
 /* showres(p,N);
  printf("\n");*/
  printf("\nthe time :"); 
  printf( "%f seconds\n",during);  
  return during;
}



float timeclock1(void (*fun)(),float *p,long n,long m)
{ clock_t start,end; 
  float during; 
  start=clock();
  (*(fun))(p,n,m);
  end=clock();
  during=(float)(end-start)/CLOCKS_PER_SEC;
  /*showres(p,N); 
  printf("\n");*/
  printf("\nthe time :"); 
  printf( "%f seconds\n",during);  
   return during;
}



float timeclock3(void (*fun)(),float *p,float *p1,long n,long m)
{ clock_t start,end; 
  float during; 
  start=clock();
  (*(fun))(p,p1,n,m);
  end=clock();
  during=(float)(end-start)/CLOCKS_PER_SEC;
 /* showres(p,N); 
  printf("\n");*/
  printf("\nthe time :"); 
  printf( "%f seconds\n",during);  
  return during;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?