The realization of high quality ultrashort pulsed beams requires ultrafast time-dependent electron optics. We present derivations of closed expressions both for the longitudinal and transverse focusing powers of resonant microwave TM010 cavities. The derived expressions are validated by particle tracking simulations using realistic cavity fields. For small field amplitudes, in which case the "weak lens" approximation holds, the focusing powers obtained from simulations are in good agreement with the derived expressions. Furthermore, the required phase and temperature stability for synchronization of electron bunches generated by femtosecond photoemission are discussed.