h0805.c

来自「学习C语言必备的好书」· C语言 代码 · 共 25 行

C
25
字号
#include <time.h>
#include <stdio.h>
#include <dos.h>
#include <conio.h>

int main(void)
{
   time_t first, second;

   clrscr();
   
   /* Gets system time */
   first = time(NULL);  

   /* Waits 2 secs */
   delay(2000);

   /* Gets system time again */
   second = time(NULL);

   printf("The difference is: %f seconds\n",difftime(second,first));
   getch();

   return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?