Electrolysis would not be used for producing electricity, ironically.
Electrolysis is the process in which electric currents are used to run non-spontaneous reactions. Rather than creating electricity, electrolysis is used for tasks along the lines of plating metals onto other metals, extracting reactive metals, and producing hydrogen gas. All of this is done through electric currents.