[C] 读取 设置BIOS时间 →→→→→进入此内容的聊天室

来自 , 2019-11-13, 写在 C, 查看 106 次.
URL http://www.code666.cn/view/25db67c5
  1. #include <stdio.h>
  2. #include <bios.h>
  3. #include <time.h>
  4. #include <conio.h>
  5.  
  6. int main ( void )
  7. {
  8.         long bios_time;
  9.  
  10.         clrscr();
  11.         cprintf ( "The number of clock ticks since midnight is:\r\n" );
  12.         cprintf ( "The number of seconds since midnight is:\r\n" );
  13.         cprintf ( "The number of minutes since midnight is:\r\n" );
  14.         cprintf ( "The number of hours since midnight is:\r\n" );
  15.         cprintf ( "\r\nPress any key to quit:" );
  16.         while ( !kbhit() )
  17.         {
  18.                 bios_time = biostime ( 0, 0L );
  19.  
  20.                 gotoxy ( 50, 1 );
  21.                 cprintf ( "%lu", bios_time );
  22.  
  23.                 gotoxy ( 50, 2 );
  24.                 cprintf ( "%.4f", bios_time / CLK_TCK );
  25.  
  26.                 gotoxy ( 50, 3 );
  27.                 cprintf ( "%.4f", bios_time / CLK_TCK / 60 );
  28.  
  29.                 gotoxy ( 50, 4 );
  30.                 cprintf ( "%.4f", bios_time / CLK_TCK / 3600 );
  31.         }
  32.         return 0;
  33. }

回复 "读取 设置BIOS时间"

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

captcha