TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Kurt Kuzba
from: Christopher Butler
date: 1998-11-18 07:28:24
subject: TC++ Delay() function...

-=[ Hi Kurt ]=-

It was 23:18:11 16 Nov 98 in C_ECHO, when the peace was suddenly disturbed
by Kurt screaming TC++ Delay() function... at Dominique Curtis. This then
followed:

 KK>    Since you are subject to system delays, the code delay may
 KK>    append to a system delay and produce an extended delay, which
 KK>    is not what you intended. Your timing routine in such cases
 KK>    should be based on system time, not on a time-based delay.
 KK>    Using the standard clock() function, you can set a point at
 KK>    which your routine will execute. If the system delays push
 KK>    your time past that point, then it will execute immediately,
 KK>    and if not, then you will have your desired delay.

According to the Linux manpage:

DESCRIPTION
       The clock() function returns an approximation of processor
       time used by the program.

So it will be effected by multi-tasker delays. Also, under a multi-tasker
like Linux, you will want to go into a sleep state. The POSIX function
sleep() does this. You could use time(), but this would be inaccurate.


Chris


--- FEddy/Linux v1.4 
* Origin: We're so glad to see so many of you lovely people h (2:257/135.6492)
SEEN-BY: 396/1 632/0 371 633/260 267 270 371 634/397 635/506 728 639/252
SEEN-BY: 670/218
@PATH: 257/135 255/1 251/25 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™.