Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Aug 2001 16:59:08 +0100
From:      Mark Ovens <marko@freebsd.org>
To:        FreeBSD Chat <chat@freebsd.org>
Cc:        Technical Information <tech_info@threespace.com>
Subject:   Re: calculating uptime
Message-ID:  <20010811165908.B275@parish>
In-Reply-To: <4.3.2.7.2.20010809225151.017e6580@threespace.com>; from tech_info@threespace.com on Thu, Aug 09, 2001 at 11:55:45PM -0400
References:  <4.3.2.7.2.20010809225151.017e6580@threespace.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 09, 2001 at 11:55:45PM -0400, Technical Information wrote:
> I currently run Windows and Linux about evenly now,

What about FreeBSD?

> going several days at a 
> time between voluntary reboots to switch to another OS.  I got curious 
> about how many of my reboots aren't voluntary (i.e., due to 
> crashes/instability) so I started paying attention to the uptime.
> 
> Since Windows has no uptime command,

W2K does, although it cheats. If you "suspend to disk" and then resume it 2
weeks later it includes those 2 weeks in the uptime.

> I downloaded a few available utilities 
> designed to give the time since the OS was booted.  The utilities I got 
> seem to work differently.  Some of them seem to calculate the difference 
> between the current time and the boot time, and others seem to count the 
> number of system ticks(*).  Since I tend to put my computer to sleep while 
> I'm not using it, this creates a pretty large discrepancy between the 
> reported uptimes during the course of a week.
> 
> My question is, what *is* the correct way to calculate uptime?  Does the 
> time that a computer is sleeping count?  One the one hand it would seem 
> that since the computer is idle that it shouldn't; on the other, since it 
> can still respond to system events (and hence can still crash) it seems 
> like it should count for something.  What are your opinions?  And what is 
> the UNIX way?
> 

By "sleeping" I presume that you mean Power Management/Energy Saving
features? As you quite rightly point out the OS is still running it's just
that the CPU is "slowed down" and disks are spun down etc. so this should
count as uptime, the OS can still respond to system events as you point out
and, I would imagine, Windows could die in it's sleep ;-)

> --Chip Morton
> 
> (*) - And what the hell is a "tick" anyway?  How many of these are there 
> per second?
> 

It's one of the system timers and is 18.2 (I think, it's 18 point something
anyway) ticks/second. I can't remember exactly what it's used for, but it
is a fixed speed irrespective of the speed of the system - it's 18.2/sec on
a 25MHz 486 and a 1.4GHz P4.

> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-chat" in the body of the message

-- 
		4.4 - The number of the Beastie
________________________________________________________________
51.44°N  FreeBSD - The Power To Serve http://www.freebsd.org
2.057°W  My Webpage http://ukug.uk.freebsd.org/~mark
mailto:marko@freebsd.org                http://www.radan.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010811165908.B275>