|
|
发表于 2005-4-21 10:25:36
|
显示全部楼层
#include <time.h>
#include <stdio.h>
#include <dos.h>
int main(void)
{
time_t tt_begin, tt_finish;
tt_begin = time(NULL); /* mark the start time */
// your code ...............
tt_finish = time(NULL); /* mark the time again */
printf("The difference is: %f seconds\n",difftime(tt_begin,tt_finish));
return 0;
}
More APIs can be found at
#man 2 time |
|