# ezQuake Manual: RTC timer patch for Linux FuhQuake 0.31

Patch was ported by disconnect.

##### ver 1.2

##### author: James Ravn <jravn@ucla.edu>

### INSTALL NOTES:

Make sure that RTC support is compiled into the linux kernel, and that the timing is set to 1024Hz. To set the timing as root:

``

    echo dev.rtc.max-user-freq=1024 >> /etc/sysctl.conf
    echo 1024 > /proc/sys/dev/rtc/max-user-freq

The first line sets the 1024Hz timing so that it is persistent through reboots, and the second line sets the 1024Hz timing right away.

Also, make sure that /dev/rtc is world readable. It usually is by default.

### OVERVIEW:

FuhQuake's handling of Linux timers is still the old arcane method of gettimeofday() that the original Linux QWCL releases use. gettimeofday() is succeptible to all kinds of problems, such as bad drifting (it can even go backwards in time!) and a fair amount of inaccuracy (exceeding +/- 10ms).

Most modern timing sensitive linux applications, such as mplayer, use the RTC if its available for utmost precision, and usleep() in all other cases. I've gone halfway and implemented RTC timer functionality into FuhQuake through this patch.

### IS IT WORTH IT?:

I haven't tested out the effects in gameplay of this patch thoroughly enough to comment, but the much increased accuracy of the timer should have noticeable effect. At the least, it can't hurt.;) Please post personal experiences at gibbage.mine.nu/forum!

### WHAT IS THE RTC:

The RTC is the real time clock that is built into hardware on your motherboard. It isn't succeptible to the usual drift that CPU based clocks suffer from. For more detailed information about the RTC check out the documentation that comes with the linux kernel (Documentation/rtc.txt) and google.

Last update: 31.12.1969 16:00 PST, made by JohnNy_cz