Moogle is correct. The spark occurs before TDC as there is a lag between the spark and the combustion of the air/fuel mixture. If the spark occured at or after TDC there would be a loss of the power that could be exerted on the piston head during power stroke.