| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | C Timer Function |
JW> a C timer function that will advance every second.
Depending on your platform and environment, this may help:
/*_|_| TIMEDATE.C PUBLIC DOMAIN Kurt Kuzba 1/10/97
_|_|_| Simple clock routine for C. */
#include
#include
#include
int main(void)
{
time_t Time = time(&Time);
char Time_Date[26], display[32];
int dsp;
do {
Time = time(&Time);
sprintf(Time_Date, "%s", ctime(&Time));
Time_Date[24] = '\0';
sprintf(display, " [ %s ] ", Time_Date);
dsp = 0;
while(display[dsp])
{
*((unsigned short far*)0xb8000064 + dsp) =
(((7 << 4) + 1) << 8) + (255 & display[dsp]);
dsp++;
}
} while(!kbhit());
while(kbhit())
getch();
return 0;
}
/*_|_| end TIMEDATE.C */
> ] * Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 634/397 635/506 728 639/252 SEEN-BY: 670/218 @PATH: 154/750 222 396/1 633/260 635/506 728 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.