Energy efficiency has become a key issue in computer science related research and development over the last years. While most approaches focus either on hardware or on software, we propose a solution incorporating both hardware and software enabling the measurement the energy consumption of code segments executed on physical machines. Our novel approach to energy measurement and instrumentation allows for both state-of-the-art offline analysis, and innovative online measurements associated with the code being executed. We present our modular architecture which shields the users from in-depth knowledge of their energy measurement hardware, and allows the development of code for measurement and instrumentation independent of each instruments' proprietary interface. Finally, we propose an efficient method for increasing the accuracy of measurements for low sampling rate measurement devices.