0

i write a code in netbeans and want to find the how much energy consumed when i run this code but i don't know how to calculate

i searched jRAPL tool but its only useful in linux environment. i don't want tools to calculate energy consumption i just want to calculate energy consumption of that particular code i have tried netbean profiler but profiler did not give me required results.

This is just as an example

for(double i=0;i<500000;i++) {
       System.out.print("Test Purpose");
}
Madhawa Priyashantha
  • 9,633
  • 7
  • 33
  • 60
  • Maybe you can use the netbeans profiler and write a custom configuration: https://profiler.netbeans.org/ https://profiler.netbeans.org/docs/help/5.5/custom_configurations.html – KeukenkastjeXYZ Apr 30 '19 at 15:41
  • That code is going to use ~0 energy, compared to everything else you have running. – Andy Turner Apr 30 '19 at 15:48
  • Note that modern processors also use energy to idle, as the clock signal still need to reach the internals of every core, reducing the clock speed is a great way to save on power – Ferrybig Apr 30 '19 at 16:11
  • is there any way to compute energy consumption of code that are running in netbean? – faisal aziz Apr 30 '19 at 17:36
  • give me answer please???? – faisal aziz May 01 '19 at 03:52
  • [1] You might want to delete your most recent comment which is likely to dissuade people from helping you. [2] Have you looked at [jRAPL -- A framework for profiling energy consumption of Java programs](http://kliu20.github.io/jRAPL/)? That link provides an example of doing exactly what you want. I didn't see any mention of it being restricted to use on Linux. [3] Did you see [this answer](https://stackoverflow.com/a/51392233/2985643) to another SO question [Is it possible to extract instruction specific energy consumption in a program?](https://stackoverflow.com/q/51390641/2985643). – skomisa May 01 '19 at 17:11

0 Answers0