freebsd-dev/games
Xin LI ea2c000633 MFC r203760: 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
2010-03-12 00:51:13 +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 MFC 199815: 2009-12-02 19:28:55 +00:00
fortune Merge r202115 from head: 2010-02-07 21:04:26 +00:00
grdc MFC r203760: Improve time precision for grdc(6): 2010-03-12 00:51:13 +00:00
morse Fixed the output grammar to properly speak non-terminal dits. 2008-06-08 19:35:47 +00:00
number Expand *n't contractions. 2005-02-13 22:25:33 +00:00
pom Make caesar and pom WARNS 6 clean. While there, use prototypes everywhere. 2005-05-01 19:34:22 +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