計算プログラム実行時間(C&C++版)

623 ワード

C++版

#include
#include
int main()
{
    clock_t start_time=clock();
    {
        //     
    }
    clock_t end_time=clock();
    cout<< "Running time is: "<(end_time-start_time)/CLOCKS_PER_SEC*1000<

C言語版

#include
#include
int main()
{
  double start=clock();
    {
        //     
    }
    double end=clock();
    printf( "
Running time is: "); printf("%fms",(double)(end-start)/CLOCKS_PER_SEC*1000); return 0; }