App code needs to know system "up time"

App code needs to know system "up time"

Post by TowXW.. » Fri, 27 Jun 2003 10:05:50



Hi.

My application code needs to know how long has the system been up. How can
it find out?

I'm figuring I can read "/proc/uptime", but is there a better way? What do
the 2 numbers in that file mean? Thanks!

If you see a 'X' in my address, remove it before e-mailing me.
If you use an e-mail client developed by Microsoft, do not add me to your
electronic address book. I do not want copies of the viruses you receive.

-------------------------------------------------------------------------------
The FAQ files v1.21 for the Tropez, and v1.01 for the TBS-2001 sound
boards can be obtained from:
http://www.landfield.com/faqs/PCsoundcards/
http://www.cs.colorado.edu/~mccreary/tbeach/faq.html
http://www.pasteur.fr/infosci/FAQ/PCsoundcards/
http://faqs.org/faqs/by-newsgroup/comp/comp.sys.ibm.pc.soundcard.misc...
-------------------------------------------------------------------------------

 
 
 

App code needs to know system "up time"

Post by Artie Gol » Fri, 27 Jun 2003 11:04:54



> Hi.

> My application code needs to know how long has the system been up. How can
> it find out?

> I'm figuring I can read "/proc/uptime", but is there a better way? What do
> the 2 numbers in that file mean? Thanks!

That _is_ the way. The first number is the number of seconds the machine
has been up, the second the amount of idle time.

See the manpages for proc ('man proc') for confirmation and details.

HTH,
--ag

--
Artie Gold -- Austin, Texas

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---