Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Calculate energy cost for your computer!


  • Please log in to reply
22 replies to this topic

#1 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 09 June 2008 - 05:14 PM

I made this, because.... I was interested! :)
Well.. it's very simple but (I think) very usefull :).
Here it is:
AutoIt         
#cs ----------------------------------------------------------------------------  AutoIt Version: 3.2.12.0  Author:         ludocus  Script Function:     Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here Opt('TrayMenuMode', 1) Opt('OnExitFunc', '_exit') $seconde = ('0.043859649122807017543859649122807'/3600) $c = TrayCreateItem('Calculate..') $e = TrayCreateItem('Exit.......') $timer = TimerInit() While 1     sleep(100)     $tMsg = TrayGetMsg()     Switch $tMsg         case $c             _energie()                 Case $e             Exit         EndSwitch         WEnd func _exit()     $time = Round((TimerDiff($timer)/1000))     $cash = $time*$seconde     msgbox ( 32, 'Calculate energy', 'This program was running for '&$time&' seconds'&@CRLF&'the energie cost of that is: € '&$cash)     Exit EndFunc func _energie()     $time = Round((TimerDiff($timer)/1000))     $cash = $time*$seconde     msgbox ( 32, 'Calculate energy', 'This program was running for '&$time&' seconds'&@CRLF&'the energie cost of that is: € '&$cash) EndFunc

Enjoy
Comments are welcome :)

Edited by ludocus, 10 June 2008 - 01:22 PM.








#2 James

James

    Universalist

  • MVPs
  • 10,194 posts

Posted 09 June 2008 - 05:46 PM

Has this actually been tested?

Also, it's "energy".

Edited by Jiim, 09 June 2008 - 05:51 PM.


#3 Nblufire12

Nblufire12

    Adventurer

  • Active Members
  • PipPip
  • 141 posts

Posted 09 June 2008 - 05:50 PM

ima test it now

dude that is frickin SWEET

#4 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 09 June 2008 - 07:34 PM

@Jiim
yep, tested and it workes great!

@Nblufire12
thnx :)

#5 James

James

    Universalist

  • MVPs
  • 10,194 posts

Posted 09 June 2008 - 07:37 PM

@Jiim
yep, tested and it workes great! :)

Accurate too?

#6 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 09 June 2008 - 07:47 PM

yep =)

#7 Kip

Kip

    Into the JavaScript

  • Active Members
  • PipPipPipPipPipPip
  • 1,690 posts

Posted 09 June 2008 - 07:57 PM

I don't think that 1 minute will cost 0.80 cent. If so my father would be a millionar.
1 = 0.80
60 = 48.00
48.00 * 7 (that's how long my computer is on) = 336 euros per day.
in a week that would be 3252 euros, and in a year 122,304 euros. (a little bit too much)

Thats a lot for one computer. (And we have three computers in our house)

#8 newbiescripter

newbiescripter

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 270 posts

Posted 09 June 2008 - 08:00 PM

I don't believe this.
if you look at it ca. 80 seconds will cost 1 euro. there is 86400 secs in a day this means that it will cost 86400 / 80 = 1080 euros pr. day for me to have my computer turned on. and that is insane :)

#9 Kip

Kip

    Into the JavaScript

  • Active Members
  • PipPipPipPipPipPip
  • 1,690 posts

Posted 09 June 2008 - 08:03 PM

I don't believe this.
if you look at it ca. 80 seconds will cost 1 euro. there is 86400 secs in a day this means that it will cost 86400 / 80 = 1080 euros pr. day for me to have my computer turned on. and that is insane :)

You copycat :)

#10 newbiescripter

newbiescripter

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 270 posts

Posted 09 June 2008 - 08:05 PM

You copycat :)


Sry :) I wasn't so fast in this one!

#11 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 09 June 2008 - 09:14 PM

lol, maybe ur right, I did some research.. prob. not trustable.. :)

#12 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 10 June 2008 - 02:02 AM

if you could find a way to read PC's power voltage you'll get more accurate readings, not all PCs waste same amount of energy.
P.S. and not all countries has the same energy costings (you can make this like input on first start of your prog. "1kw = xx euros" xx = editable :))
P.S.S. I like the idea of the prog, it would be cool if you could make it more accurate :)
good luck :)

#13 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 10 June 2008 - 01:10 PM

im sory... I forgot to do seconds in stead of millie seconds,
Edited main post. It works all good now :)

#14 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 10 June 2008 - 01:18 PM

there was still something wrong.. Edited it again. Now works great! :) I'm sorry...

#15 HeffeD

HeffeD

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 10 June 2008 - 05:29 PM

if you could find a way to read PC's power voltage you'll get more accurate readings, not all PCs waste same amount of energy.

Yep. Pretty useless to try and put a price on energy usage based only on time running...

In other words, you need to take into account the wattage of the power supply, amount of peripherals being used, type of software being run, etc... Running a CPU under full load conditions is going to draw a lot more current than a CPU basically idling. If you are playing a 3D video game, your CPU and your graphics card are going to be working much harder than if you are running a word processing application. (higher current draw, more wattage burned, therefore higher cost) A simple 'timer' for both situations just doesn't cut it...

It's a bit like calculating gas consumption based purely on mileage, but not taking into account the vehicle doing the driving. It should be obvious that per mile, a small hybrid vehicle driving on a flat road is going to burn far less fuel than a large pickup pulling a fifth-wheel trailer (large recreational trailer) up a hill. Per mile, you're looking at a huge different in actual energy used! Looking at mileage without taking into consideration the actual engine size, load size, and even operating conditions gives you zero indication of the actual cost of the energy used...

#16 James

James

    Universalist

  • MVPs
  • 10,194 posts

Posted 10 June 2008 - 05:32 PM

Most Vista PC's have the ability to change the mode in which it runs as well.

#17 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 11 June 2008 - 02:27 PM

true... but my thingie is just about what your computer spends on energy..
if you have your computer on stand by or something it's less.. of course..
but this is between lowest and max (kwh)..
and of course the price per kwh changes for every house...
but as I said this is about what people pay for a kwh.. (€ 0,22 / kWh)
I am dutch and I got my knowledge about this subject here: http://www.milieucentraal.nl/pagina?onderwerp=Computers

570 hours (active use) is 114 kwh wich costs: € 25,-

2184 hours (stand-by) is 175 kwh wich costs: € 38,-

6006 hours (sleeping) is 48 kwh wich costs: € 11,-

of course I could use the cpu usage to try to get the price..
but I just did it this way.. the about cost of energy for your computer..
but thanks for replieing :)

#18 C2C

C2C

    Adventurer

  • Active Members
  • PipPip
  • 108 posts

Posted 01 July 2008 - 12:38 PM

I think the main variable in the computers consumption of electrical current is the monitor (and the muscle graphic cards) depending on size and simple background color depends how much your monitor (which I think is the main energy leech) will use electricity.

About the background color:
Apparently on a CRT monitor ALL white screen means large energy consumption. Because of the way they function black is just not "drawing anything" but on LCD TFT monitors black color just means that every transitor is powered/lit but so are the "dimmers/blockers" => more energy.

As for the power supply i dont think that IT on its own has a lot to do with consumption for instance i have 450W UPS and it was working just fine while i had my old graphics card and monitor but i still had a 750W power supply, but now when the power goes out it works for like 1s and then wham => graphics card + larger monitor make it go :P

So to sum it all up :P
Ludocus program does the average but if you would like to pinpoint it down (a bit) i think the graphics card and monitor should be taken in to consideration. Ill try to find some comparative chart or something on how much energy those cost so maybe we can make something of it.

Good job keep it up bro :)
----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win

#19 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 01 July 2008 - 05:18 PM

thnx, I hope you can find it..

#20 FireFox

FireFox

    It slips through our fingers, like a fist full of sand.

  • MVPs
  • 5,373 posts

Posted 17 November 2008 - 01:51 PM

Hello Ludocus,
I've found fine your script so I make little script with your script for have cash cost in real time an exemple here :

Plain Text         
#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Opt('TrayOnEventMode', 1) Opt('TrayMenuMode', 1) Opt('GuiOnEventMode', 1) TrayCreateItem("Quit") TrayItemSetOnEvent(-1,"_Exit") $TIMER = TimerInit() $SEC=('0.043859649122807017543859649122807'/3600) $win=GUICreate("Ca$h Timer  <d3montools>",260,80,-1,-1,$WS_CAPTION,BitOr($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW)) $TIME=GUICtrlCreateLabel("TIMER : STARTING...",5,5,250,30) GUICtrlSetFont(-1,20) $CASH=GUICtrlCreateLabel("CASH : STARTING...",12,45,250,30) GUICtrlSetFont(-1,20) GUISetState() While 1     sleep(250) GUICtrlSetData($TIME,"TIMER : "&Round((TimerDiff($timer)/1000))) If Round((TimerDiff($timer)/1000))<10 Then GUICtrlSetData($CASH,"CASH : < 0.00012 €") Else $CASHSL=StringLeft(Round((TimerDiff($timer)/1000))*$SEC,7) GUICtrlSetData($CASH,"CASH : "&$CASHSL&" €") EndIf WEnd Func _Exit() Exit EndFunc



And final version with count cash off all process and clock with hour,min,sec
Plain Text         
#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Opt('TrayOnEventMode', 1) Opt('TrayMenuMode', 1) Opt('GuiOnEventMode', 1) TrayCreateItem("Ca$h") TrayItemSetOnEvent(-1, "_SHOW") TrayCreateItem("") TrayCreateItem("Quit") TrayItemSetOnEvent(-1, "_Exit") TraySetToolTip("Ca$h...") $TIMER = TimerInit() $SEC = ('0.043859649122807017543859649122807' / 3600) $win = GUICreate("Ca$h Timer  <d3montools>", 260, 80, -1, -1, -1, BitOR($WS_EX_APPWINDOW, $WS_EX_TOOLWINDOW)) GUISetOnEvent($GUI_EVENT_CLOSE, "_HIDE") $TIME = GUICtrlCreateLabel("TIMER : STARTING...", 5, 5, 250, 30) GUICtrlSetFont(-1, 20) $CASH = GUICtrlCreateLabel("CASH : STARTING...", 12, 45, 250, 30) GUICtrlSetFont(-1, 20) GUISetState() While 1     Sleep(250)     If Round((TimerDiff($TIMER) / 1000)) < 60 Then         GUICtrlSetData($TIME, "TIMER : " & Round((TimerDiff($TIMER) / 1000)) & " SEC")     ElseIf Round((TimerDiff($TIMER) / 1000)) > 60 _             And Round((TimerDiff($TIMER) / 1000)) < 3600 Then         $MIN = Round((TimerDiff($TIMER) / 1000)) / 60         $MINT = StringLeft($MIN, 5)         GUICtrlSetData($TIME, "TIMER : " & $MINT & " MIN")     ElseIf Round((TimerDiff($TIMER) / 1000)) > 3600 Then         $HOUR = Round((TimerDiff($TIMER) / 1000)) / 3600         $HOURT = StringLeft($HOUR, 5)         GUICtrlSetData($TIME, "TIMER : " & $HOURT & " HOUR")     EndIf     $PC = ProcessList()     $CASHT = StringLeft(Round((TimerDiff($TIMER) / 1000)) * $PC[0][0] * $SEC, 7)     GUICtrlSetData($CASH, "CASH : " & $CASHT & " €")     TraySetToolTip(GUICtrlRead($TIME) & @CRLF & GUICtrlRead($CASH)) WEnd Func _Exit()     Exit EndFunc  ;==>_Exit Func _HIDE()     GUISetState(@SW_HIDE, $win) EndFunc  ;==>_HIDE Func _SHOW()     GUISetState(@SW_SHOW, $win) EndFunc  ;==>_SHOW


Have fun ^^ :mellow:

Edited by FireFox, 17 November 2008 - 02:58 PM.

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.

Hardware : Intel® Core™ i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

Updated 07 November, 2013 - If you find dead links please send me a PM, do not post in the topics !





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users