time execution
This commit is contained in:
parent
25528786d8
commit
e84528359c
1 changed files with 10 additions and 1 deletions
11
tmain.c
11
tmain.c
|
@ -1,8 +1,17 @@
|
|||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
extern long f(void);
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("f() = %ld\n", f());
|
||||
clock_t t0;
|
||||
long l;
|
||||
|
||||
t0 = clock();
|
||||
l = f();
|
||||
t0 = clock() - t0;
|
||||
printf("f() = %ld\n", l);
|
||||
printf(" %.4f secs\n", (double)t0/CLOCKS_PER_SEC);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue