freebsd-nq/games
Xin LI eb1930d3f2 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
caesar
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
primes
random Suggections from bde@ 2008-08-11 23:24:42 +00:00
Makefile
Makefile.inc