Accurate methods to measure Energy in a RLC Circuit
The thing is to use an oscilloscope which allows mathematical manipulations with the displayed traces. If you consider the below electrical circuit, you see a \$RLC\$ network excited with an initial condition (.IC) in the capacitor. 



The scope can display the inductive current in one trace while the second displays the voltage across the capacitor. Provided you can square the inputs, the instantaneous energy is defined as \$w_{tot}(t)=w_L(t)+w_C(t)=\frac{1}{2}Li_L^2(t)+\frac{1}{2}Cv_C^2(t)\$. If everything is fine, you should obtain the following graph:



You can see that energy peaks in the capacitor at \$t=0\$ then transfers back and forth between the two energy-storing elements \$C\$ and \$L\$. Because of the resistance presence, this energy transfer is lossy and power is dissipated in heat in the resistance. The resistive term is damping the circuit and provides a real term to the circuit poles. The more resistance you have, the less efficient the circuit is: response is oscillatory and quickly dying out to 0. On the opposite, as \$R\$ reduces, less power is dissipated during the oscillation process which lasts longer. If \$R\$ is 0, or if you provide a means to actively compensate the losses, the real part of the roots disappears and the poles are purely imaginary: you have built an oscillator. Please note that damping does not occur only via the ohmic paths but also through magnetic and dielectric losses.

You can read the quality factor \$Q\$ from the voltage across the capacitor. The first negative peak is 3.645 V while the second is 1.938 V. The quality factor is computed by \$Q=\sqrt{\left(\frac{3.14}{ln(\frac{3.645}{1.938})}\right)^2+0.25}=4.996\$. The other approach is to compute the quality factor using energy: \$Q=2\pi\frac{(stored\;energy)}{(energy\;dissipated\;per\;cycle)}\$.