方法一,#include int main(){ time_t timep;struct tm *p;time (&timep);p=gmtime(&timep);printf("%d\n",p->tm_sec); /*获取当前秒*/ printf("%d\n",p->tm_min); /*获取当前分*/ printf("%d\n",8+p->tm_hour);/*获取当前时,这里获取西方的时间,刚好相差八个小时*/ pr...
1.用difftime,秒级 include include <stdio.h> include <dos.h> int main(void){ time_t first, second;first = time(NULL); /* Gets system time */ // 你的程序 ...second = time(NULL); /* Gets system time ...