| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | TC++ Delay() function... |
Hello!
KK> Spinning_Cursor(char *prompt) { char *spinner = "|/-\"; clock_t go;
KK> int spin = 0, keypress; output_function_string(prompt); do { spin %=
KK> 4; output_function_char(spinner[spin++]); go = clock() +
KK> CLOCKS_PER_SEC / 2 /* This calculates the clock value of a
KK> half-second delay, but not an absolute hard-coded delay. It is
KK> dynamically responsive to system events. Continuation of code
KK> execution will be tested against this clock value, and will proceed
KK> as soon as it is exceeded, whether within the loop, or within other
KK> code. */ do { keypress = input_function(); } while(!keypress
&& go >
KK> clock()); connect_error = test_connect(); } while(!keypress &&
KK> !connect_error); return keypress; }
The text editor messed this all up, but anyhow.. I used your
function and it worked MUCH better.. it still slows down/speeds
up under a multi-node, multitasking situation, but much less
noticably... thanks a lot... what were the
connect_error/text_connect functions for? I'm going to modify that
function and use it wherever I use the delay() functions..because
under multitasking, these delay times also vary..sometimes even
doubled in length to what they are supposed to be.
Ciao!
... Careful planning is the key to safe and swift travel.
-*- SabreEDIT v1.72a+ [STS97]
--- Ezycom V1.48g0 01fa0167
* Origin: Milky Way, Langley, BC [604] 532-4367 (1:153/307)SEEN-BY: 396/1 632/0 371 633/260 267 270 371 634/397 635/506 728 639/252 SEEN-BY: 670/218 @PATH: 153/307 8086 800 140/1 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™.