From owner-freebsd-chat Sat Aug 11 8:59:17 2001 Delivered-To: freebsd-chat@freebsd.org Received: from mta01-svc.ntlworld.com (mta01-svc.ntlworld.com [62.253.162.41]) by hub.freebsd.org (Postfix) with ESMTP id B896B37B408 for ; Sat, 11 Aug 2001 08:59:13 -0700 (PDT) (envelope-from mark@ntlworld.com) Received: from parish ([62.255.97.7]) by mta01-svc.ntlworld.com (InterMail vM.4.01.03.00 201-229-121) with ESMTP id <20010811155911.WFEV15984.mta01-svc.ntlworld.com@parish>; Sat, 11 Aug 2001 16:59:11 +0100 Received: (from mark@localhost) by parish (8.11.4/8.11.3) id f7BFxDU27285; Sat, 11 Aug 2001 16:59:13 +0100 (BST) (envelope-from mark) Date: Sat, 11 Aug 2001 16:59:08 +0100 From: Mark Ovens To: FreeBSD Chat Cc: Technical Information Subject: Re: calculating uptime Message-ID: <20010811165908.B275@parish> References: <4.3.2.7.2.20010809225151.017e6580@threespace.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i 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 Organization: Total lack of Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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