freebsd-skq/games
delphij 3e4cd4ab75 Improve time precision for grdc(6):
Traditionally, grdc would obtain time through time(3) which in turn gets
only the second part of clock (CLOCK_SECOND), and sleep for 1 second after
each screen refresh.

This approach would have two problems.  First, we are not guaranteed to
be waken up at the beginning of a whole second, which will typically
exhibit as a "lag" on second number.  Second, because we sleep for whole
second, and the refresh process would take some time, the error would
accumulate from time to time, making the lag variable.

Make grdc(6) to use time(3) to get time only at the beginning, and sample
time in CLOCK_REALTIME_FAST granularity after refreshing, and use the
nanosecond part to caculate how much time we want to sleep.

PR:		bin/120813
MFC after:	1 month
2010-02-10 18:20:20 +00:00
..
bcd Resolve a couple of warnings and bump WARNS to 6. 2004-07-11 17:26:18 +00:00
caesar Make caesar and pom WARNS 6 clean. While there, use prototypes everywhere. 2005-05-01 19:34:22 +00:00
factor Fix a performance bug in factor(6). 2009-11-26 00:38:13 +00:00
fortune Add the definition of Mistakeholder 2010-02-09 14:51:39 +00:00
grdc Improve time precision for grdc(6): 2010-02-10 18:20:20 +00:00
morse Always compile in the speaker code. There's little savings by 2010-02-04 07:08:06 +00:00
number Use ANSI C function declarations. 2009-12-29 08:43:32 +00:00
pom Fix build: getopt() returns int so use an integer to get the value. 2010-01-06 00:20:37 +00:00
ppt Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
primes Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
random Suggections from bde@ 2008-08-11 23:24:42 +00:00
Makefile
Makefile.inc