您的位置:首页 > 移动开发 > IOS开发

读取或设置BIOS时间

2015-09-18 08:10 381 查看
#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:\r\n" );
	cprintf( "The number of seconds since midnight is:\r\n" );
	cprintf( "The number of minutes since midnight is:\r\n" );
	cprintf( "The number of hours since midnight is:\r\n" );
	cprintf( "\r\nPress 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);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: