---
title: "在c程序中计算运行时间"
author: "daning"
date: "2008-05-26T00:28:17Z"
tags: []
slug: "c"
draft: false
lastmod: "2008-05-26T00:28:17Z"
id: 196823
url: "https://daning.iteye.com/blog/196823"
---

算法对比时使用：

```
#include   <time.h>
int   main( )
{
clock_t start, finish;
double duration;
start=clock();
//.......
finish=clock();
duration=(double)(finish-start)/CLOCKS_PER_SEC;
printf( "%f\n", duration);
} 
```