# Time stepping (2D FDTD) **Time stepping** advances the electromagnetic fields through discrete intervals of duration $\Delta t$. FDTD CUDA uses a leapfrog scheme: the electric field is sampled at integer time steps, while the magnetic field is sampled halfway between them. Each step follows this dependency: $$ \left(E_z^n,H_x^{n-\frac12},H_y^{n-\frac12}\right) \longrightarrow \left(H_x^{n+\frac12},H_y^{n+\frac12}\right) \longrightarrow E_z^{n+1} $$ The magnetic update uses the current electric field. After magnetic sources are added, the electric update uses the new magnetic field, then electric sources are added. The [[fdtd-cuda-yee-grid|Yee grid]] staggers samples in space; leapfrog stepping staggers them in time. After the first completed step, $E_z$ corresponds to time $\Delta t$, while $H_x$ and $H_y$ correspond to $\Delta t/2$. `probe_times()` accounts for this offset when returning measurement times. The components in a snapshot therefore represent staggered times too. `Simulation::run(nsteps)` advances from the current state, so successive calls continue the simulation and source waveforms. The [[fdtd-cuda-cfl-stability-condition|CFL stability condition]] limits the time step used by these updates.