How to measure energy consumption of python code running on CPU?
I want to measure the energy consumption of a python code which is running on a traditional cpu. For example, the code is a = np.random.randn(1000, 1000) b = np.random.randn(1000, 1000) # this is the code I want to measure: c = a @ b I wonder if there is a method that can tell me the duration and energy consumption of c = a @ b, such as duration = 2ms and energy consumption = 1.38mJ. I have tried a tool called pyJoules as below, it says it can measure the energy footprint of python code: from pyJoules.energy_meter import measure_energy import numpy as np x = np.random.randn(1000, 1000) y = np.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.