Skip to main content

Module rate

Module rate 

Source
Expand description

The rates the timer can be run at.

Each names what it counts. The hardware divides one of four clocks by a power of two, and these are the ones a program can afford: every overflow runs the handler.

Hz163264128256512102420484096819216384
CPU0.05%0.1%0.2%0.4%0.7%1.5%2.9%5.9%12%23%47%

The figures are for an original Game Boy. CGB double speed mode halves each of them, since the handler costs the same and the processor issues twice as much in a second.

The hardware counts faster than 16384 Hz, but the handler would take more of the processor than the program has left to give.

Each rate is paired with the fastest clock that reaches it, which leaves Timer::count dividing the period as finely as it can.

Structsยง

Hz32
32 Hz.
Hz64
64 Hz.
Hz128
128 Hz.
Hz256
256 Hz.
Hz512
512 Hz.
Hz1024
1024 Hz.
Hz2048
2048 Hz.
Hz4096
4096 Hz.
Hz8192
8192 Hz.
Hz16384
16384 Hz.