This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System Up Time

 
Bill Norton
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Randall Twede
Ranch Hand
Posts: 4363
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic