my dog learned polymorphism*
The moose likes Beginning Java and the fly likes System Up Time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "System Up Time" Watch "System Up Time" New topic
Author

System Up Time

Bill Norton
Greenhorn

Joined: Mar 29, 2001
Posts: 27
Let me be more more specific.
In rfc1514 a variable is described as
systemUpTime which is how long it has been since the system was initialized.
I believe almost any system(Linux, Solaris, NT, HPUX, etc) keeps this information somehow. I was hoping that there was a Java method which would return this value.
Thank you,
Bill

[This message has been edited by Bill Norton (edited April 10, 2001).]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Up time?? Time it was turned on? Time it has been running since turned on?? Either way I don't think that windows (at any rate) tracks either of those.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

Im not sure what you mean by current system's up time.
But if this helps any, If you are using servlets, you can find out how long since the server was booted by recording when init() was called with this code in the init() method:
String dateTime = DateFormat.getDateTimeInstance().format(date);
then to find elapsed time you would have to use the same line(with different variable name) and do some math.
not sure if that helps any.
------------------
Dont blindly believe everything I say.


SCJP
Visit my download page
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: System Up Time