These are two different actions: show a real time rendering, and saving frames to hard disk, eg. to make a movie. The latter action is generally not done in real time, and doesn't need to be RT anyway. Motion pictures we see in theaters, like Shrek, use farms of computers to render them, and it probably takes several minutes (or more) to render a second of movie... They can see the animation in real time, but with wireframe rendering, or very primitive textures.
On your sketch, you can have a global variable controlling the rendering mode: real time without saveFrame() and frame saving mode.
If you really want to mix the two, you can try and save to a Flash device (USB key or SSD), or even make a virtual disk in Ram. There will still be a slowdown at CPU level, as the image must be compressed and structured in the destination format. Unless you use a format like TGA, which doesn't compress (or has a simplistic but fast compression method).