[C] 计算两个时刻之间的时间差 →→→→→进入此内容的聊天室

来自 , 2021-03-10, 写在 C, 查看 135 次.
URL http://www.code666.cn/view/cd3afef9
  1. #include <time.h>
  2. #include <stdio.h>
  3. #include <dos.h>
  4. #include <conio.h>
  5.  
  6. int main ( void )
  7. {
  8.         time_t first, second;
  9.  
  10.         clrscr();
  11.         first = time ( NULL );  /* Gets system
  12.       time */
  13.         delay ( 2000 );      /* Waits 2 secs */
  14.         second = time ( NULL ); /* Gets system time
  15.       again */
  16.  
  17.         printf ( "The difference is: %f \
  18.   seconds\n",difftime ( second,first ) );
  19.         getch();
  20.  
  21.         return 0;
  22. }
  23.  

回复 "计算两个时刻之间的时间差"

这儿你可以回复上面这条便签

captcha