In 2017, the world produced 25,980,400 gigawatt hour (Gwh) of electricity. Basically the same amount was consumed, less the amount lost during electricity transportation along the global electric grids (transmission lines and distribution lines).
If you want to know more, please go here. This data was sourced from the book Transportation and the Belt and Road Initiative, in which more data as well as the original primary sources of the data are available.