To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.javaOpen lugnet.robotics.rcx.java in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / Java / 180
179  |  181
Subject: 
MinuteTimer and currentTimeMillis()
Newsgroups: 
lugnet.robotics.rcx.java
Date: 
Sat, 15 Jun 2002 17:18:20 GMT
Viewed: 
3850 times
  
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 valid to the millisecond, is it keeping the value
internally in an int or a long?  I thought long(s) were not implemented.  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?  If you call MinuteTimer.reset(), does
that reset the currentTimeMillis() value?  Is there a way to reset it?

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?  As an aside, when the MinuteTimer class was
written, the JavaDoc was copied over from Battery.  Thank you for the help.

Frederick N. Brier



Message has 1 Reply:
  Re: MinuteTimer and currentTimeMillis()
 
(...) An int, 4 bytes. (...) That's right. (...) 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 :-) (...) No, (...) (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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR