計算程式執行時間
程式如下: 

//Name : ExecuteTime.exe
//Method: 在提示指令下打:  ExecuteTime 欲測試的檔案的名稱
//EX: ExecuteTime input.exe

#include<stdio.h>
#include<time.h>
int main(int argc,char *argv[])
{
	clock_t begin,end;

	begin = clock();
	system(argv[1]);
	end = clock();

	printf("\n%f\n",(float)(end-begin)/CLK_TCK);
	return 0;

}

 
回目錄
Written By James On 2004/02/08 

Hosted by www.Geocities.ws

1