Public potential that the tactic is obtainable to be utilized by utilising any of the linked classes in the equipment of the undertaking. Void potential that the tactic does no longer return something. subsequently once you're executing a public void variety approach, you're normally doing something that does no longer disrupt the contents of alternative classes in a fashion that could be risky (i.e. having the consumer replace the values of many of the gadgets you create) and void merely potential that the tactic will output something that may not might desire to be utilized by utilising a diverse classification/approach. case in point, some public void methods might incorporate: printing out a shopper interface menu for a shopper calculating new values based on the variables of alternative (like math applications)
Desman Hynes
2007-10-10 16:45:32 UTC
Thx
anonymous
2007-10-10 22:09:48 UTC
Your problem here is one of accuracy. There is a minimum amount of time that any given computer's time clock measures. The time clock, of course, is the one that measures real time- how many seconds have passed. The problem is, the time clock is MUCH slower than the processor.
So, what's happening is that the two instances where your code asks for the time- which come right after each other in your example with nothing in between to take up any time- happen in WAAAAAY less time than it takes for the time clock to tick. Presumably you have something in between in real use, but it also gets blazed through in less than a tick. Thus, when you get to the second call, it's actually made at exactly the same time- as far as your computer can tell- as the first one.
The accuracy of the time clock varies from machine to machine, but often they're accurate to about 10 milliseconds. That's some five-hundredth or so the shortest time a human can measuer, but it's a very, very long time in computer terms. Probably, millions of times longer than it takes to determine start and then determine stop.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.