Subject:
|
Re: MinuteTimer and currentTimeMillis()
|
Newsgroups:
|
lugnet.robotics.rcx.java
|
Date:
|
Sat, 15 Jun 2002 19:17:27 GMT
|
Viewed:
|
3984 times
|
| |
| |
"Frederick N. Brier" <fbrier@multideck.com> writes:
>
> If currentTimeMillis() is valid to the millisecond, is it keeping the value
> internally in an int or a long?
An int, 4 bytes.
> I thought long(s) were not implemented.
That's right.
> If it is a 32 bit int, then the max value is approx. 2 billion. Since there
> are 86400000 milliseconds in a day, that means the clock would roll over
> every 24 days. Is this the case?
I think a complete cycle will take 49.7 days, as you have to get through
the negative values, too. But I bet nobody has yet tried it.
(Somewhat like the MSWindows sure crash a while ago :-)
> If you call MinuteTimer.reset(), does
> that reset the currentTimeMillis() value?
No, it resets the separate minute time of the ROM.
> Is there a way to reset it?
No. But you can just store a reference value and compute the difference,
that's about the same.
> If the MinuteTimer class and the value of
> currentTimeMillis() are completely independent, how do you
> retrieve the two byte value of the MinuteTimer? It only
> has the reset() method. Does it have a known memory
> location that be accessed via the Memory class?
Yes, at efd2. Seems we should add some access method.
> As an aside, when the MinuteTimer class was
> written, the JavaDoc was copied over from Battery.
I'm not quite sure I understand your remark
(is it that the comment is wrong and says Battery?)
but I'll have a look.
Jürgen
--
Jürgen Stuber <stuber@loria.fr>
http://www.loria.fr/~stuber/
|
|
Message is in Reply To:
| | MinuteTimer and currentTimeMillis()
|
| I am writing a class which can be set with the actual time and then provide the value to other classes. It only has to be accurate to the minute. I've done this in NQC, but am trying to figure out how to do it using Lejos. If currentTimeMillis() is (...) (22 years ago, 15-Jun-02, to lugnet.robotics.rcx.java)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|