Synchrotron beamlines typically use macroscopic, quasi-static optics to manipulate x-ray beams. We present the use of dynamic microelectromechanical systems-based optics (MEMS) to temporally modulate synchrotron x-ray beams. We demonstrate this concept using single-crystal torsional MEMS micromirrors oscillating at frequencies of 75 kHz. Such a MEMS micromirror, with lateral dimensions of a few hundred micrometers, can interact with x rays by operating in grazing-incidence reflection geometry; x rays are deflected only when an x-ray pulse is incident on the rotating micromirror under appropriate conditions, i.e., at an angle less than the critical angle for reflectivity. The time window for such deflections depends on the frequency and amplitude of the MEMS rotation. We demonstrate that reflection geometry can produce a time window of a few microseconds. We further demonstrate that MEMS optics can isolate x rays from a selected synchrotron bunch or group of bunches. With ray-trace simulations we explain the currently achievable time windows and suggest a path toward improvements.