C语言函数—brk

函数名

biostime

功 能

读取或设置BIOS时间

用 法

long biostime(int cmd, long newtime);

程序例

#include <stdio.h> 
#include <bios.h> 
#include <time.h> 
#include <conio.h> 

int main(void) 
{ 
   long bios_time; 

   clrscr(); 
   cprintf("The number of clock ticks since midnight is:rn"); 
   cprintf("The number of seconds since midnight is:rn"); 
   cprintf("The number of minutes since midnight is:rn"); 
   cprintf("The number of hours since midnight is:rn"); 
   cprintf("rnPress any key to quit:"); 
   while(!kbhit()) 
   { 
      bios_time = biostime(0, 0L); 

      gotoxy(50, 1); 
      cprintf("%lu", bios_time); 

      gotoxy(50, 2); 
      cprintf("%.4f", bios_time / CLK_TCK); 

      gotoxy(50, 3); 
      cprintf("%.4f", bios_time / CLK_TCK / 60); 

      gotoxy(50, 4); 
      cprintf("%.4f", bios_time / CLK_TCK / 3600); 
   } 
   return 0; 
} 
  
  
  

如果引用本站的原创文章,请注明原文链接:,本站保留追究责任的权利!