I am creating a program that makes a calculation every minute. I don't know exactly how to do this efficiently, but this is some pseudo code I have written so far:
stockCalcTimerH = System.currentTimeMillis() - 1; stockCalcTimerI = stockCalcTimerH; stockCalcTimer = System.currentTimeMillis(); if (stockCalcTimerI < stockCalcTimer) { *do calcuations* stockCalcTimerI + 60000; When I print both values out on the screen, it comes out as this:
stockCalcTimerI = 1395951070595 stockCalcTimer = 1395951010596
It only subtracts the number, and doesn't add the 60000 milliseconds... I'm kind of new to Java, but any feedback helps.
Thanks for reading!!
stockCalcTimerI + 60000;? If you meanstockCalcTimerI += 60000;then ok never adds 60000 milliseconds.