Run Antic's 1989 Bottleneck Breaker, a sampling profiler for Atari BASIC: how a POKEY timer interrupt reads STMCUR 250 times a second, how to use it on your own program, and how to read its report.
How ANTIC steals CPU cycles for refresh, display lists, playfield and player graphics, the 114-cycle scan line, WSYNC and VCOUNT timing, and a tested program that measures the cost of each screen mode.