October 7, 20169 yr Hey guys i'm feeling really stupid right now... lol I don't know if it's because i'm running on no sleep for the past almost 24 hours or what but i can't figure out how to calculate items per hour? I already have current clay mined with the variable xCount; and I have a current time running variable of timeRun; any help please? lol Thanks in advance!
October 7, 20169 yr This is what i use: itemsmadeperhour= (int)(itemsmade / ((System.currentTimeMillis() - this.timeBegan) / 3600000.0D)); And then just add this in paint: g.drawString("Items p/h: " + itemsMadePerHour, 1, 1); Edited October 7, 20169 yr by Stealth Quester
October 7, 20169 yr Logical walkthrough: Save time started startedAt = System.currentTimeMillis() Get Running time runTime = System.currentTimeMillis() - startedAt Convert runtime milliseconds to hours hoursRan = runTime / 3600000 Calculate per hour perHour = itemsMade / hoursRan
Create an account or sign in to comment