Make timer.c example more readable.

Split some complex ifs to make all steps more obvious.