We use the Lanczos method to calculate the variance σ2(E, ϕ) of the number of energy levels in an energy window of width E below the Fermi energy for noninteracting disordered electrons on a thin three-dimensional ring threaded by an Aharonov–Bohm flux ϕ. We confirm numerically that for small E the flux-dependent part of σ2(E, ϕ) is well described by the Altshuler–Shklovskii-diagram involving two Cooperons. However, in the absence of electron–electron interactions this result cannot be extrapolated to energies E where the energy-dependence of the average density of states becomes significant. We discuss consequences for persistent currents and argue that for the calculation of the difference between the canonical- and grand canonical current it is crucial to take the electron–electron interaction into account.