|
|
楼主 |
发表于 2010-8-12 09:26:05
|
显示全部楼层
#include <STDIO.H>* a* N% X# N0 J/ {. g# ~8 n: f
#include <BIOS.H>
/ Y0 S0 n7 [2 U" J# o#include <TIME.H>
) w% w$ L" R, x% f" s#include <CONIO.H>, e8 S$ t5 @9 t
int main(void)5 g H6 ~) A9 E: j' L1 Z0 N
{ long int bios_time;
" t4 ]% `6 L- ` clrscr();
+ y% I) I+ P' |; u4 s cprintf("The number of clock ticks since midnight is:\r\n");
+ U$ R+ h! V# L1 ~! L8 B) g* r" z* w cprintf("The number of seconds since midnight is:\r\n");. P/ z, a {$ Y2 s" Q7 p1 i' P
cprintf("The number of minutes since midnight is:\r\n");
8 y, _& R- L: P% l; E* `: D cprintf("The number of hours since midnight is:\r\n");( i% S, n5 s$ O7 G; {
textcolor(9);. q% S) q/ K9 i: q: Q
cprintf("\r\nPress any key to quit:");9 ~4 W7 r4 s& G, |* b2 p
textcolor(12);# g8 J* I% f! ?# f" w
while(!kbhit()) {* I# D; @; {! ~5 e# v
bios_time = biostime(0, 0L);" e* [( i: @: a% Y
gotoxy(50, 1);) t* d! \; O+ E
cprintf("%lu", bios_time);! ?2 v! f6 g7 B0 H4 ^! }
gotoxy(50, 2);
2 |4 H& _; `' e4 P& ? cprintf("%.4f", bios_time / CLK_TCK);8 |2 U' Y% y2 h( g! O9 d& L
gotoxy(50, 3);7 W0 X' X, Y) `5 i$ z6 f# O
cprintf("%.4f", bios_time / CLK_TCK / 60);5 d$ g; T0 H2 L1 r- C
gotoxy(50, 4);1 V* M) ]. p% o: l& [
cprintf("%.4f", bios_time / CLK_TCK / 3600);
& [9 C5 y" b5 X ? }
. o( G" D( ?+ K; } return 0;
9 E1 C( H4 {" j} 0 A! p g$ c/ X' [' {
" @' B4 l# t6 n
' y7 F3 U# v- Y3 Y# O: G' M+ |9 A! b; G% Q- h- k- D$ B
TC运行一下,然后把biostime(0,0L)括号里面的数值改掉运行一下,再改回原值,你就知道我问的是什么了,初学,不知道怎么问,见谅。 |
|