China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 20:37
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Help: C program How to respond to key presses during delay? View 11,726 Replies 0
Original Poster Posted 2021-04-01 11:36 ·  中国 天津 联通
高级用户
★★
Credits 687
Posts 222
Joined 2005-08-21 22:37
20-year member
UID 41842
Status Offline
Turbo C environment, program overview:
-------------------------------
while (no key pressed) {
display string
sleep(5 minutes) / delay(5 minutes)
clear string
change screen coordinates
}
-------------------------------

Requirement: When no key is pressed, refresh the string every 5 minutes. And respond to key presses at any time (exit when a key is pressed).

Now the situation is that although there is a key pressed, it must wait until the 5 minutes are up before it can exit.
Forum Jump: