Energy consumption measurement is very important for developers of modern embedded systems. Basically, there are two types of measurement methods: the simulation-based and the physical-based. For energy consumption analysis, the simulation-based measurement is slow and inaccurate. Though the typical physical-based measurement is fast and accurate, while it can not get detail system information. Therefore, we propose a task-based measurement that bases on the physical-based measurement to provide system information. However, previous works can not use system information to derive more detailed hardware dependent information well, such as the power consumption of CPU, memory, I/O devices, etc. In this thesis, we propose a novel idea to extract the power consumption of I/O devices, and verify our work through experiments on DMA. Experiments show that we can use our method to have an acceptable result. We believe this thesis is helpful for not only users who would like to measure the energy consumption of applications, but also provide a fast approach to developers who would like to get more hardware dependent information.