Energy Measurement and Profiling of Internet of Things Devices