We study the optimal exercise of a swing option in electricity markets. To this end, we set up a model in terms of a stochastic control problem. In this model, the option can be exercised in continuous time and is subject to a total volume constraint. We analyze some fundamental properties of the model and carry out a numerical analysis. Finally, we illustrate the results numerically.